Tabify
is a SwiftUI view that elegantly utilizes interactive user interface elements to dynamically switch between multiple child views.
It is highly customizable and, due to its similarity to the native TabView
SwiftUI component, very user-friendly and easy to use.
- SwiftUI
- iOS 13.0 or above
The preferred way of installing Tabify
is via the Swift Package Manager.
- In Xcode, open your project and navigate to File → Add Packages
- Paste the repository URL (
https://github.com/bgeisb/Tabify.git
) and click Next. - For Rules, select Up to Next Major Version.
- Click Add Package.
⏳ Coming soon...
Make sure your enum implements the
TabifyItem
protocol.
enum TabifyItems: Int, TabifyItem {
case home = 0
case search
case profile
var icon: String {
switch self {
case .home: return "house"
case .search: return "magnifyingglass"
case .profile: return "person"
}
}
var title: String {
switch self {
case .home: return "Home"
case .search: return "Search"
case .profile: return "Profile"
}
}
}
Tabify(selectedItem: $tabBarSelection) {
Text("Home")
.tabItem(for: TabifyItems.first)
Text("Search")
.tabItem(for: TabifyItems.second)
Text("Profile")
.tabItem(for: TabifyItems.third)
}
/* This following modifiers are optional. You can use them to inject your custom bar and item styling. */
.barStyle(style: CustomTabifyBarStyle())
.itemStyle(style: CustomTabifyItemStyle())
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.