I have a simple main app architecture:
struct ContentView: View {
@State private var isSignedIn = false
@AppStorage("onboardingCompleted") var onboardingCompleted: Bool = false
var body: some View {
Group {
if onboardingCompleted && isSignedIn {
MainView()
} else {
OnboardingView()
}
}
.onAppear() {
signIn()
}
}
OnboardingView is a NavigationView. MainView is a TabView. I switch between these when the user finishes onboarding. However, as the user taps on the finish button in the last onboarding step, this gets written to the console:
Trying to pop to a missing destination - SwiftUI/NavigationBridge_PhoneTV.swift:213 - please file a bug report.
In production, this causes a crash. I looked around and it seems it is an issue when you embed TabView inside NavigationView or vice versa? But here it's not the case, they are standalone and I switch between them.
Any thoughts?