2
我的應用程序如何等待,直到我的調用API完成?我的「didFinishLaunchingWithOptions」如何等待,直到調用API完成
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
GMSServices.provideAPIKey("AIzadGlsfR35k4BeHCXmRq3GDSQ-l_5gcD8")
FlicAuth.sharedInstance
//Call Api here
application.registerUserNotificationSettings(UIUserNotificationSettings(forTypes: [.Alert, .Badge, .Sound], categories: nil))
application.registerForRemoteNotifications()
if(launchOptions?[UIApplicationLaunchOptionsLocationKey] != nil){
LocationService.sharedInstance.startMonitoringLocation()
}
return FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
}
感謝的提前
我們可以問爲什麼你會想要這樣做? – Gruntcakes
你不希望它等待。如果時間太長,iOS會殺死你的應用程序,以延長啓動時間。 – rmaddy
我想改變我的第一個屏幕取決於我從API調用的數據 –