Hi friends I am not understanding one thing
static func checkAppVer() -> Bool {
var status = false
API.sharedInstance.checkApp(completion: { success, response in
if success {
if (response) != nil {
let apiAppVesrion = response?.configValue ?? ""
let appVers = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? ""
if appVers >= apiAppVesrion {
status = true
}else{
status = false
}
}
}else{
status = false
}
})
return status
}
In the given code when I add break point code run like this
- status var call
- the last return status
- the api result call
but code should call synchronously one by one. I am not understanding why it going on. I can handle this by using closure but I just want to know why this is going. Thanks in advance.