Replies: 2 comments
-
Switch between modules using conditional logicWithout SwiftfulRouting:ZStack {
if isSignedIn {
NavigationView {
TabBarView()
}
}
if !signedIn {
NavigationView {
OnboardingView()
}
}
}With SwiftfulRouting:ZStack {
if isSignedIn {
RouterView { _ in
TabBarView()
}
}
if !signedIn {
RouterView { _ in
OnboardingView()
}
}
}Show onboarding as a sheet or fullScreenCoverWithout SwiftfulRouting:ZStack {
NavigationView {
TabBarView()
}
.onAppear {
if !isSignedIn {
showOnboardingView = true
}
}
.sheet(isPresented: $showOnboardingView, content: {
OnboardingView()
})
}With SwiftfulRouting:ZStack {
RouterView { router in
TabBarView()
.onAppear {
if !isSignedIn {
router.showScreen(.sheet) { _ in
OnboardingView()
}
}
}
}
}
.onOpenURL { url in
router.showScreen(.sheet) { _ in
MyScreen(url: url)
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
If you have multiple tabs, you could alternatively do this so that each tab has it's own routing ZStack {
RouterView { _ in
Tab1()
}
.tabBarItem {}
RouterView { _ in
Tab2()
}
.tabBarItem {}
RouterView { _ in
Tab3()
}
.tabBarItem {}
RouterView { _ in
Tab4()
}
.tabBarItem {}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Will be great to see description:
As an example navigating from top of NavigationView in one screen to another tab with
Beta Was this translation helpful? Give feedback.
All reactions