Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

application didFinishLaunchingWithOptions method: [closed]

Tags:

ios

swift

What does it mean to put something in my application didFinishLaunchingWithOptions method:. And how do I do it in Swift?

like image 903
tarjerw Avatar asked Jul 20 '26 05:07

tarjerw


1 Answers

There is a boilerplate method provided in your iOS project's AppDelegate file defined as

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

    // Override point for customization after application launch. Here you can out the code you want.

    return true
}

If you want to handle cases such as if app is opened by a URL or by remote notification then you might want to put your code before return.

If the app can handle the url then keep the return value true otherwise false. In case of a push notification, the return value would anyway be ignored.

Hope this would help.

like image 164
BLC Avatar answered Jul 22 '26 20:07

BLC