I have TabView in ContentView and I want to add TabView for OnboardingView in OtherView, every things work, but it is throw error for TabView in OtherView like "Trailing closure passed to parameter of type 'Int' that does not accept a closure" I do not know why? Any idea?
ContentView:
struct TabView : View {
var body: some View{
VStack(spacing: 0){
.......
}
OtherView:
VStack {
TabView {
ForEach(onboardingData) { onboardingItem in
OnboardingCard(onboardingItem: onboardingItem)
}
}
.tabViewStyle(PageTabViewStyle(indexDisplayMode: .automatic))
.indexViewStyle(PageIndexViewStyle (backgroundDisplayMode:
.always))
.foregroundColor(.white)
}