Skip to content

Instantly share code, notes, and snippets.

@Dimillian
Created May 4, 2020 06:23
Show Gist options
  • Save Dimillian/c82d16928a7cd612492b40394eb95012 to your computer and use it in GitHub Desktop.
Save Dimillian/c82d16928a7cd612492b40394eb95012 to your computer and use it in GitHub Desktop.
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
let contentView = TabbarView()
.environmentObject(Items())
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