Last active
November 3, 2020 18:45
-
-
Save aheze/4cc608afc6b4f4e5c161fa66c020a04e to your computer and use it in GitHub Desktop.
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
| import UIKit | |
| import SwiftUI | |
| // Auto-generated code | |
| class SceneDelegate: UIResponder, UIWindowSceneDelegate { | |
| var window: UIWindow? | |
| 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). | |
| // Create the SwiftUI view that provides the window contents. | |
| let contentView = ContentView() | |
| // 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() | |
| } | |
| } | |
| ... Lots more code! | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment