Last active
August 9, 2020 11:27
-
-
Save cipolleschi/b575dda4ac8bb2b83fe9cabde0610339 to your computer and use it in GitHub Desktop.
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
| class SceneDelegate: UIResponder, UIWindowSceneDelegate { | |
| func scene( | |
| _ scene: UIScene, | |
| willConnectTo session: UISceneSession, | |
| options connectionOptions: UIScene.ConnectionOptions | |
| ) { | |
| // ... | |
| // create the view controller we need | |
| let vc = buildViewController() | |
| let window = UIWindow(windowScene: scene) | |
| window.rootViewController = vc | |
| window.makeKeyAndVisible() | |
| self.window = window | |
| } | |
| func buildViewController() -> UIViewController { | |
| #if UITESTING | |
| // Parse the parameter using userDefaults | |
| let initialScreen = UserDefaults.standard.string(forKey: "initialScreen") | |
| // Switch over the possible values | |
| if initialScreen == "home_screen" { | |
| return HomeViewController() | |
| } | |
| return LegalViewController() | |
| #endif | |
| return LegalViewController() | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment