Last active
September 24, 2020 06:15
-
-
Save samkhawase/62e987726feb0ea71cee7eb210a8424f to your computer and use it in GitHub Desktop.
Method that acts as an entrypoint to our Scene based app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Method that acts as an entrypoint to our Scene based app | |
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { | |
// Create the SwiftUI view that provides the window contents. | |
let contentView = ContentView(viewModel: PhotoStreamViewModel()) | |
// Use a UIHostingController as window root view controller. | |
if let windowScene = scene as? UIWindowScene { | |
let window = UIWindow(windowScene: windowScene) | |
window.rootViewController = UIHostingController(rootView: contentView) | |
self.window = window | |
window.makeKeyAndVisible() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment