I just discovered that the following simple code snippet has a very confusing behavior on iOS 15.0-15.1.
When I go to the NavigationLink
, the child page pops up unexpectly once the app goes into the background and reopens. This issue does not happen on iOS 14.
struct ContentView: View {
var body: some View {
NavigationView {
TabView {
NavigationLink {
Text("👀 Go to background. This view will pop.")
} label: {
Text("Push")
}
}
}
.navigationViewStyle(.stack)
}
}
You may have noticed that I have nested the TabView in the NavigationView, and this issue is related to this structure. Like many social apps such as Telegram and WeChat, I believe nesting TabView in NavigationView is a widely used structure. I am very hopeful that this issue will be resolved.