title: reading json wrong when checking app updates
body: <p>I'm using the following code to check whether an update is available or not. But it gave me wrong version number. So, it seems an update is available when actually there's not.</p>
  
  <pre><code>enum VersionError: Error {
      case invalidResponse, invalidBundleInfo
  }
  
  static func isUpdateAvailable() throws -&gt; Bool {
      guard let info = Bundle.main.infoDictionary,
          let currentVersion = info["CFBundleShortVersionString"] as? String,
          let identifier = info["CFBundleIdentifier"] as? String,
          let url = URL(string: "http://itunes.apple.com/tr/lookup?bundleId=\(identifier)") else {
              throw VersionError.invalidBundleInfo
      }
      let data = try Data(contentsOf: url)
      guard let json = try JSONSerialization.jsonObject(with: data, options: [.allowFragments]) as? [String: Any] else {
          throw VersionError.invalidResponse
      }
      if let result = (json["results"] as? [Any])?.first as? [String: Any], let version = result["version"] as? String {
  
          print("version: \(version)")   //writes 1.1
          print("currentVersion: \(currentVersion)") //writes 1.1.1
          return version != currentVersion
      }
      throw VersionError.invalidResponse
  }
  </code></pre>
  
  <p>I downloaded the file manually and the version number there is 1.1.1. as it should be. But the code gives me 1.1. I couldn't find out what is wrong. </p>
  
  <p>By the way, the update has just released today. I think it shouldn't be related with that.</p>
  
  <p>The url: <a href="http://itunes.apple.com/tr/lookup?bundleId=com.sahin.lingustica" rel="nofollow noreferrer">http://itunes.apple.com/tr/lookup?bundleId=com.sahin.lingustica</a></p>