Skip to content

Instantly share code, notes, and snippets.

@aybekckaya
Last active May 5, 2020 14:40
Show Gist options
  • Save aybekckaya/5a465a86b35198037d82532d2e27eac2 to your computer and use it in GitHub Desktop.
Save aybekckaya/5a465a86b35198037d82532d2e27eac2 to your computer and use it in GitHub Desktop.
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
guard let windowScene = (scene as? UIWindowScene) else { return }
self.window = UIWindow(windowScene: windowScene)
let vc = FirstViewController()
self.window?.rootViewController = vc
self.window?.makeKeyAndVisible()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment