Skip to content

Commit

Permalink
Merge pull request #12 from Jayson-Furr/scene-support
Browse files Browse the repository at this point in the history
Update SceneDelegate.swift
  • Loading branch information
peterfriese committed Jun 15, 2020
2 parents 00e086a + 8a80d67 commit caeefb5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions final/MakeItSo/MakeItSo/App/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
// 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).

// Create the SwiftUI view that provides the window contents.
let contentView = TaskListView()

// Use a UIHostingController as window root view controller.
if let windowScene = scene as? UIWindowScene {
let window = UIWindow(windowScene: windowScene)

// Create the SwiftUI view that provides the window contents.
// Set the window EnvironmentKey to the current window for the contentView's environment.
let contentView = TaskListView().environment(\.window, window)

window.rootViewController = UIHostingController(rootView: contentView)
self.window = window
window.makeKeyAndVisible()
Expand Down

0 comments on commit caeefb5

Please sign in to comment.