Skip to content

Instantly share code, notes, and snippets.

@ZkHaider
Last active June 6, 2019 02:53
Show Gist options
  • Save ZkHaider/56b57657976258a9cf793ff8d95287e9 to your computer and use it in GitHub Desktop.
Save ZkHaider/56b57657976258a9cf793ff8d95287e9 to your computer and use it in GitHub Desktop.
Window Setup with 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 Scene set to UIWindow
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment