I'm new to IOS and I'm trying to find the Android method onTaskRemoved(Intent rootIntent)
for IOS. This is the documentation for the method: https://developer.android.com/reference/android/app/Service#onTaskRemoved(android.content.Intent). I'm just wondering if there is a equivalent method in IOS or should this be implemented from scratch? The closest I get is the WillTerminate()
method.
CodePudding user response:
Since there are no direct equivalent of Android services in iOS the answer will depend on what you mean.
For example, if you mean the termination of you application you can use the following UIApplicationDelegate method:
optional func applicationWillTerminate(_ application: UIApplication)
ref: Apple applicationWillTerminate documentation.
Or for example a notification:
ref: Apple willTerminateNotification documentation.
Otherwise, if you meant a background executions you also have various delegate methods which you can find here.