TabViewWithPageStyleType

@MainActor
public struct TabViewWithPageStyleType : IntrospectableViewType

An abstract representation of the TabView type in SwiftUI, with .page style.

struct ContentView: View {
    var body: some View {
        TabView {
            Text("Page 1").frame(maxWidth: .infinity, maxHeight: .infinity).background(Color.red)
            Text("Page 2").frame(maxWidth: .infinity, maxHeight: .infinity).background(Color.blue)
        }
        .tabViewStyle(.page(indexDisplayMode: .always))
        .introspect(.tabView(style: .page), on: .iOS(.v14Later)) {
            print(type(of: $0)) // UICollectionView
        }
    }
}
  • Undocumented

    See more

    Declaration

    Swift

    public enum Style