Search code examples
iosswiftxcodeios13uiscenedelegate

iOS 13 - applicationWillTerminate from UIApplicationDelegate equivalent for UISceneDelegate?


I'm using iOS 13 and its new UISceneDelegate and I want to execute a function when app is killed.

I used to use the applicationWillTerminate function from UIApplicationDelegate but I don't see this function in UISceneDelegate.

So what is the best way to do it using UISceneDelegate ?


Solution

  • It's still inside AppDelegate

    func applicationWillTerminate(_ application: UIApplication) {
        print("applicationWillTerminate")
    }