HomeiOS Developmentios - How one can stop app from launching (go to preliminary...

ios – How one can stop app from launching (go to preliminary view controller) earlier than get response from url request in swift


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

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments