Last active
August 15, 2019 16:43
-
-
Save WildStudio/547bffa9562b1e97eb93580a3b2bd3bb to your computer and use it in GitHub Desktop.
SceneDelegate.swift snippet
This file contains 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
// Instantiate a new UIWindow with the size of our phone screen and assign it to the window property | |
let window = UIWindow(frame: UIScreen.main.bounds) | |
// Instantiate a UIHostingController which is a ViewController but it is capable of holding the new SwiftUI View. | |
window.rootViewController = UIHostingController(rootView: ContentView()) | |
self.window = window | |
// Make the window key and visible. This is telling it is the active window. | |
window.makeKeyAndVisible() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment