let path = "https://itunes.apple.com/lookup?id=APPID"
SVProgressHUD.show()
Alamofire.request(path, method: .post).response {[weak self] (responseObj) in
SVProgressHUD.dismiss()
guard let weakself = self else { return }
if responseObj.error == nil {
let dic:Dictionary = try! JSONSerialization.jsonObject(with: responseObj.data!, options: JSONSerialization.ReadingOptions.mutableContainers) as! Dictionary<String,Any>
if dic["resultCount"] as! Int > 0{
let results:Array = dic["results"] as! Array<Any>
if results.count > 0 {
let resultsDic:Dictionary = results.first as! Dictionary<String,Any>
let version = resultsDic["version"] as! String
if version > MGNetwork.share.appVersion {
}else{
}
}
}else{
SVProgressHUD.showError(withStatus: "检测版本失败".mgLocal)
}
}else{
SVProgressHUD.showError(withStatus: "检测版本失败".mgLocal)
}
}
网友评论