Skip to content

Commit

Permalink
Save settings before exit
Browse files Browse the repository at this point in the history
  • Loading branch information
levinli303 committed Nov 29, 2020
1 parent e69eda3 commit 372af86
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 0 additions & 7 deletions MobileCelestia/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
6 changes: 6 additions & 0 deletions MobileCelestia/MainSceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

import UIKit

import CelestiaCore

@available(iOS 13, *)
class MainSceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
Expand Down Expand Up @@ -43,6 +45,10 @@ class MainSceneDelegate: UIResponder, UIWindowSceneDelegate {
}

func sceneDidDisconnect(_ scene: UIScene) {
let core = CelestiaAppCore.shared
if core.isInitialized {
core.storeUserDefaults()
}
exit(0)
}
}

0 comments on commit 372af86

Please sign in to comment.