AT
Size: a a a
AT
J
func needsUpdate() -> Bool {
let infoDictionary = Bundle.main.infoDictionary
let appID = infoDictionary!["CFBundleIdentifier"] as! String
guard let url = URL(string: "http://itunes.apple.com/lookup?bundleId=\(appID)") else { return false }
guard let data = try? Data(contentsOf: url) else {
return false
}
let lookup = (try? JSONSerialization.jsonObject(with: data, options: [])) as? [String: Any]
if let resultCount = lookup!["resultCount"] as? Int, resultCount == 1 {
if let results = lookup!["results"] as? [[String:Any]] {
if let appStoreVersion = results[0]["version"] as? String{
let currentVersion = infoDictionary!["CFBundleShortVersionString"] as? String
if !(appStoreVersion == currentVersion) {
return true
}
}
}
}
return false
}
VG
VG
R🦐
R🦐
R🦐
D
R🦐
J
IA
IA
J
AH