Skip to content

Instantly share code, notes, and snippets.

@ZkHaider
Last active June 6, 2019 02:55
Show Gist options
  • Save ZkHaider/0dd5039a6fc443055c5d2c36e7ce4454 to your computer and use it in GitHub Desktop.
Save ZkHaider/0dd5039a6fc443055c5d2c36e7ce4454 to your computer and use it in GitHub Desktop.
SceneDelegate - Apple's new Scene API
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene,
willConnectTo session: UISceneSession,
options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = (scene as? UIWindowScene) else { return }
window = UIWindow(frame: windowScene.coordinateSpace.bounds)
window?.windowScene = windowScene
window?.rootViewController = ViewController(nibName: nil, bundle: nil)
window?.makeKeyAndVisible()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment