Created
August 19, 2017 16:46
-
-
Save Herakleis/3172b351386be7e6babac8f4ef2db2cd to your computer and use it in GitHub Desktop.
AppDelegate+Coordinator
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 | |
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate { | |
var window: UIWindow? | |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool { | |
// Manually creates the window and makes it visible. | |
window = UIWindow(frame: UIScreen.main.bounds) | |
window?.makeKeyAndVisible() | |
window?.rootViewController = UIViewController() // Dummy VC for Coordinator's init | |
let sceneCoordinator = SceneCoordinator(window: window!) | |
let firstSceneViewModel = FirstSceneViewModel(coordinator: sceneCoordinator) | |
let firstScene = Scene.firstScene(firstSceneViewModel) | |
sceneCoordinator.transition(to: firstScene, type: .root) | |
return true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment