func utility(_ utility: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
APICaller().fetchUser(completionHandler: {baseData, error in
if let baseData = baseData{
APICaller().fetchBaseData = baseData
}
})
// Override level for personalization after utility launch.
return true
}
I’ve code like that in AppDelegate.swift, what I anticipated is I need APICaller().fetchBaseData get response information from URL request earlier than launching the Preliminary View Controller. However on this case the code do not wait till url request get response. That make the APICaller().fetchBaseData nil when entry by preliminary view controller