Skip to content

Instantly share code, notes, and snippets.

@roz0n
Created February 21, 2021 18:59
Show Gist options
  • Save roz0n/85a98c164d281d4375f25be3b7eae930 to your computer and use it in GitHub Desktop.
Save roz0n/85a98c164d281d4375f25be3b7eae930 to your computer and use it in GitHub Desktop.
iOS SceneDelegate Programmatic UI Setup
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let scene = (scene as? UIWindowScene) else { return }
let vc = ViewController()
let nc = UINavigationController(rootViewController: vc)
window = UIWindow(frame: scene.coordinateSpace.bounds)
window?.windowScene = scene
window?.rootViewController = nc
window?.makeKeyAndVisible()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment