Last active
April 15, 2020 20:18
-
-
Save fredriccliver/aa5447d72cc50bf5aa1dade6603dad17 to your computer and use it in GitHub Desktop.
SceneDelegate.swift of Storyboard project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class SceneDelegate: UIResponder, UIWindowSceneDelegate { | |
var window: UIWindow? | |
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { | |
guard let _ = (scene as? UIWindowScene) else { return } | |
} | |
func sceneDidDisconnect(_ scene: UIScene) {} | |
func sceneDidBecomeActive(_ scene: UIScene) {} | |
func sceneWillResignActive(_ scene: UIScene) {} | |
func sceneWillEnterForeground(_ scene: UIScene) {} | |
func sceneDidEnterBackground(_ scene: UIScene) { | |
(UIApplication.shared.delegate as? AppDelegate)?.saveContext() | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment