Skip to content

Instantly share code, notes, and snippets.

@Dimillian
Last active July 26, 2019 08:02
Show Gist options
  • Save Dimillian/cb275e4f7563397ed6f6cdd5670d003a to your computer and use it in GitHub Desktop.
Save Dimillian/cb275e4f7563397ed6f6cdd5670d003a 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) {
if let windowScene = scene as? UIWindowScene {
let window = UIWindow(windowScene: windowScene)
let controller = UIHostingController(rootView:
StoreProvider(store: store) {
HomeView()
})
window.rootViewController = controller
self.window = window
window.makeKeyAndVisible()
}
}
}
private let store = Store<AppState>(reducer: appStateReducer,
middleware: [loggingMiddleware],
state: AppState())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment