i want to use TabView to display some data. I'm using paged view style for this.
struct ContentView: View {
@State var texts: [String] = ["first", "second"]
var body: some View {
TabView {
ForEach(texts, id: \.self) { text in
VStack {
Button(action: {
texts.append("next one...")
}, label: {
Text("Button")
})
Text(text)
}
}
}
.tabViewStyle(PageTabViewStyle())
.indexViewStyle(PageIndexViewStyle(backgroundDisplayMode: .always))
}
}
As expected the view comes up to display two pages ("first" and "second"). When i'm pressing the button a new page indicator is added (so i see three dots in the page index) but i can't scroll to the third page.
Am i missing something, or is this a bug in Xcode?