Skip to content

Instantly share code, notes, and snippets.

@bpisano
Created June 18, 2019 09:37
Show Gist options
  • Select an option

  • Save bpisano/bd770bd5bcdc1b14a06a6867f356c1e2 to your computer and use it in GitHub Desktop.

Select an option

Save bpisano/bd770bd5bcdc1b14a06a6867f356c1e2 to your computer and use it in GitHub Desktop.
Embedded code in my Weather article on Medium
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