TabStriper is a library that switches screens by selecting a tab or swiping the screen Built with SwiftUI
struct ColorView: View {
let color: Color
var body: some View {
self.color
}
}
struct ContentView: View {
let colorViews: [StripView] = [
StripView(id: 1, title: "green", view: AnyView(ColorView(color: .green))),
StripView(id: 2, title: "blue", view: AnyView(ColorView(color: .blue)))
]
var body: some View {
TabStriper(stripViews: self.colorViews)
.barColor(.red)
.titleColor(.gray)
.selectedTitleColor(.black)
}
}
TabStriper
is available via Swift Package Manager.
Using Xcode 11, go to File -> Swift Packages -> Add Package Dependency
and enter https://github.com/giiiita/TabStriper.git