Skip to content

Instantly share code, notes, and snippets.

@paulaleite
Created January 27, 2021 17:28
Show Gist options
  • Save paulaleite/2f0b5657d2a2614cd3af5827171e0076 to your computer and use it in GitHub Desktop.
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
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