I got a screen with TabView which holds two tabs:
...
var body: some View {
TabView() {
ScreenViewOne().tabItem {
Image(systemName: "calendar")
Text("Screen one")
}.tag(0)
ScreenViewTwo().tabItem {
Image(systemName: "list.bullet")
Text("Screen two")
}.tag(1)
}
}
...
When I tap Screen two tab, the app crashes with the following error:
precondition failure: unknown attribute: 4294967295
If I use the same screen for both tabs like shown below, everything works as expected and there is no crash:
...
var body: some View {
TabView() {
ScreenViewOne().tabItem {
Image(systemName: "calendar")
Text("Screen one")
}.tag(0)
ScreenViewOne().tabItem {
Image(systemName: "list.bullet")
Text("Screen two")
}.tag(1)
}
}
...
Changing the order of the screens, their content, etc. doesn't help.