diff --git a/MobileCelestia/AppDelegate.swift b/MobileCelestia/AppDelegate.swift index cfe512ae..dc20ebc5 100644 --- a/MobileCelestia/AppDelegate.swift +++ b/MobileCelestia/AppDelegate.swift @@ -81,13 +81,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { return true } - func applicationWillTerminate(_ application: UIApplication) { - let core = CelestiaAppCore.shared - if core.isInitialized { - core.storeUserDefaults() - } - } - func application(_ application: UIApplication, shouldSaveApplicationState coder: NSCoder) -> Bool { return false } diff --git a/MobileCelestia/MainSceneDelegate.swift b/MobileCelestia/MainSceneDelegate.swift index 1d901659..cdec42ad 100644 --- a/MobileCelestia/MainSceneDelegate.swift +++ b/MobileCelestia/MainSceneDelegate.swift @@ -11,6 +11,8 @@ import UIKit +import CelestiaCore + @available(iOS 13, *) class MainSceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? @@ -43,6 +45,10 @@ class MainSceneDelegate: UIResponder, UIWindowSceneDelegate { } func sceneDidDisconnect(_ scene: UIScene) { + let core = CelestiaAppCore.shared + if core.isInitialized { + core.storeUserDefaults() + } exit(0) } }