Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,32 @@ Use like any other TabView:
```swift
import SwiftUI
import VTabView

VTabView {

...
@State private var selectedIndex = 0
VTabView(selection: $selectedIndex, indexPosition: .trailing) {
Text("The First Tab")
.tabItem {
Image(systemName: "square.fill")
}
.tag(0)
Text("Another Tab")
.tabItem {
Image(systemName: "circle.fill")
}
.tag(1)
Text("The Last Tab")
.tabItem {
Image(systemName: "triangle.fill")
}
.tag(2)
}
.tabViewStyle(.page(indexDisplayMode: .always))
.onAppear {
// White dots won't appear on white background.
UIPageControl.appearance().currentPageIndicatorTintColor = .green
UIPageControl.appearance().pageIndicatorTintColor = UIColor.green.withAlphaComponent(0.2)
}
.tabViewStyle(PageTabViewStyle())
```

You can also move index to the right
Expand Down