Skip to content

Instantly share code, notes, and snippets.

@Herakleis
Created August 19, 2017 16:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Herakleis/3172b351386be7e6babac8f4ef2db2cd to your computer and use it in GitHub Desktop.
Save Herakleis/3172b351386be7e6babac8f4ef2db2cd to your computer and use it in GitHub Desktop.
AppDelegate+Coordinator
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