Created
June 18, 2019 09:37
-
-
Save bpisano/bd770bd5bcdc1b14a06a6867f356c1e2 to your computer and use it in GitHub Desktop.
Embedded code in my Weather article on Medium
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 | |
| class SceneDelegate: UIResponder, UIWindowSceneDelegate { | |
| var window: UIWindow? | |
| func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { | |
| // Use a UIHostingController as window root view controller | |
| let window = UIWindow(frame: UIScreen.main.bounds) | |
| let cityStore = CityStore() | |
| window.rootViewController = UIHostingController(rootView: CityListView().environmentObject(cityStore)) | |
| self.window = window | |
| window.makeKeyAndVisible() | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment