- Select
Xcode -> File -> Swift Packages -> Add Package Dependency...
- Enter
https://github.com/wxxsw/TabBar
. - Click
Next
, then select the version, complete.
- iOS 13+
- Xcode 11+
- Swift 5+
struct ContentView : View {
@State private var selection: Int = 0
var body: some View {
NavigationView {
TabBar(selection: $selection) {
HomeView()
.tabBarItem(0) { Image("chat") }
ContactView()
.tabBarItem(1) { Image("contact") }
DiscoverView()
.tabBarItem(2) { Image("discover") }
MeView()
.tabBarItem(3) { Image("me") }
}
}
}
}
Open TabBar.xcodeproj
and run Demo
target.
TabBar is released under the MIT license. See LICENSE for details.