init() { self = .login(.init()) } } public struct AppState: Equatable { public var login: LoginState? = LoginState() public var newGame: NewGameState? public init() {} } public var body: some View { SwitchStore(self.store) { CaseLet( state: /AppState.login, action: AppAction.login ) { store in NavigationView { LoginView(store: store) } .navigationViewStyle(StackNavigationViewStyle()) } CaseLet( state: /AppState.newGame, action: AppAction.newGame ) { store in NavigationView { NewGameView(store: store) } .navigationViewStyle(StackNavigationViewStyle()) } } @ViewBuilder public var body: some View { IfLetStore( self.store.scope(state: \.login, action: AppAction.login) ) { store in NavigationView { LoginView(store: store) } .navigationViewStyle(StackNavigationViewStyle()) } IfLetStore( self.store.scope(state: \.newGame, action: AppAction.newGame) ) { store in NavigationView { NewGameView(store: store) } .navigationViewStyle(StackNavigationViewStyle()) } } ҎલͷΓํ 4XJUDI4UPSF$BTF-FUͰͷΓํ 4XJGU6*7JFX 4XJGU6*7JFX 4UBUF 4UBUF