Swift 2.2 For iOS 8 or later apps to process at startup

Asked 2 years ago, Updated 2 years ago, 40 views

I'd like to do a specific process when starting the application.

·Starting from the state that the application is completely closed
·Starting from the state where the application exists in the background

I would like to do different things in the above conditions, but is there any way to determine them?
Please let me know.

ios swift xcode

2022-09-30 11:13

1 Answers

If it's just those two,

application:didFinishLaunchingWithOptions:

If is called, "Start from a state where the app is completely closed",

applicationWillEnterForeground:

If is called, it will be "starting from the state that the app is in the background", so you can use these two methods differently.

https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/TheAppLifeCycle/TheAppLifeCycle.html#//apple_ref/doc/uid/TP40007072-CH2-SW3


2022-09-30 11:13

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.