I'm using TabView to have a simple onboarding contents. It seems like when voiceOver is enabled and tabview get the focus binding variable automatically will reset to 0. here is sample app I made for this issue:
struct ContentView: View {
@State var selectedIndex = 0
var body: some View {
VStack {
Text("Header")
TabView(selection: $selectedIndex) {
ForEach((0...2), id: \.self) { index in
Button {
selectedIndex += 1
} label: {
Text("at: \(selectedIndex), Goto Next Tab")
}
.tag(index)
}
}
.tabViewStyle(.page(indexDisplayMode: .never))
.indexViewStyle(.page(backgroundDisplayMode: .never))
Text("Footer")
}
.padding()
}
}
I used accessibility inspector to check behaviour and here is the result