We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let say I have a coordinator like this:
import Foundation import RMStoreKit import Stinsen import SwiftUI final class AccountCoordinator: NavigationCoordinatable { let stack = NavigationStack(initial: \AccountCoordinator.start) @Root var start = makeStart @Route(.fullScreen) var sports = makeSportScreen @Route(.push) var joinCodeTeam = makeJoinTeamScreen @Route(.push) var teamJoinCodeSettings = makeTeamJoinCodeSettingsScreen @Route(.fullScreen) var subscription = makeSubscriptionModal let mainViewModel: MainViewModel init(mainViewModel: MainViewModel) { self.mainViewModel = mainViewModel } @ViewBuilder func makeStart() -> some View { AccountsView() .environmentObject(mainViewModel) } func makeSportScreen() -> NavigationViewCoordinator<CreateTeamCoordinator> { NavigationViewCoordinator( CreateTeamCoordinator(sportsViewModel: ViewModelBuilder.build(), mainViewModel: mainViewModel) ) } func makeJoinTeamScreen() -> some View { JoinTeamView() .environmentObject(mainViewModel) } @ViewBuilder func makeTeamJoinCodeSettingsScreen() -> some View { if let selectedTeam = mainViewModel.selectedTeam { TeamJoinCodeView(viewModel: TeamJoinCodeViewModel(team: selectedTeam)) .environmentObject(mainViewModel) } } @ViewBuilder func makeSubscriptionModal() -> some View { RMSubscriptionModal() } }
How do I detect which route I am current at so I can adjust my logic accordingly?
if (accountRouters?.isRoot(\.sports)).orFalse() { // do something } else { // do something else }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Let say I have a coordinator like this:
How do I detect which route I am current at so I can adjust my logic accordingly?
The text was updated successfully, but these errors were encountered: