Skip to content

Instantly share code, notes, and snippets.

@badlands
Created July 2, 2019 22:07
Show Gist options
  • Save badlands/627fd65e57e4eb640a8a5340c4956d5b to your computer and use it in GitHub Desktop.
Save badlands/627fd65e57e4eb640a8a5340c4956d5b to your computer and use it in GitHub Desktop.
Xcode 11 beta 2 vs beta 3
// MARK: - Beta 2 code
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).
// Use a UIHostingController as window root view controller
let window = UIWindow(frame: UIScreen.main.bounds)
window.rootViewController = UIHostingController(rootView: ContentView())
self.window = window
window.makeKeyAndVisible()
}
// MARK: - Beta 3 code
/// Note: window initialization changed to: UIWindow(windowScene: windowScene)
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).
// Use a UIHostingController as window root view controller
if let windowScene = scene as? UIWindowScene {
let window = UIWindow(windowScene: windowScene)
//window.rootViewController = UIHostingController(rootView: EmptyView())
window.rootViewController = UIHostingController(rootView: ContentView().environmentObject(sudokuApp))
self.window = window
window.makeKeyAndVisible()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment