Created
January 27, 2021 17:28
-
-
Save paulaleite/2f0b5657d2a2614cd3af5827171e0076 to your computer and use it in GitHub Desktop.
Com o Scene Delegate deveria ficar após a retirada do Storyboard, utilizando Coordinators
This file contains 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 { | |
var window: UIWindow? | |
var coordinator: MainCoordinator? | |
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { | |
guard let windowScene = scene as? UIWindowScene else { return } | |
let navigationController = UINavigationController() | |
coordinator = MainCoordinator(navigationController: navigationController) | |
coordinator?.start() | |
window = UIWindow(frame: .zero) | |
window?.makeKeyAndVisible() | |
window?.rootViewController = navigationController | |
window?.windowScene = windowScene | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment