BetterTabBar

0.1.0

A better TabBar for your iOS App
bircni/BetterTabBar

What's New

0.1.0

2023-11-06T22:52:10Z

This is the first prerelease 😄

What's Changed

New Contributors

  • @bircni made their first contribution in #1

Full Changelog: https://github.com/bircni/BetterTabBar/commits/0.1.0

Platforms Swift Versions Build

BetterTabBar

Enhance your App with a better TabBar!

Example

Installation

Swift Package Manager

Add the following to your Package.swift file:

let package = Package(
    ...
    dependencies: [
        ...
        .package(name: "BetterTabBar", url: "https://github.com/bircni/BetterTabBar.git", from: "0.1.0"),
    ],
    targets: [
        .target(
            name: "MyApp",
            dependencies: ["BetterTabBar"] // Add as a dependency
        )
    ]
)

Add package dependency in Xcode

Use this guide to add BetterTabBar to your project. Use https://github.com/bircni/BetterTabBar for the URL when Xcode asks.

Usage

Use the Example in this repository as a starting point.

Create a main View and add the BetterTabBar

import SwiftUI
import BetterTabBar

struct ContentView: View {
    @AppStorage("tabId") var tabId: Int = 0

    var body: some View {
        ZStack (alignment: .bottom){
            switch tabId {
            case 0:
                VStack {
                    Spacer()
                    Text("View 1")
                    Spacer()
                }
            case 1:
                VStack {
                    Spacer()
                    Text("View 2")
                    Spacer()
                }
            case 2:
                VStack {
                    Spacer()
                    Text("View 3")
                    Spacer()
                }
            case 3:
                VStack {
                    Spacer()
                    Text("View 1")
                    Spacer()
                }
            default:
                Text("View 1")
            }
            
            BetterTabBar(tabId: $tabId, strokeColor: .blue, strokeLineWidth: 2, spacing: 25, cornerRadius: 30, height: 60, tapFeedback: true, buttons: [
                TabButton(selectedImage: Image(systemName: "bus"), unselectedImage: Image(systemName: "bus.fill"), lightColor: .green, darkColor: .blue),
                TabButton(selectedImage: Image(systemName: "car"), unselectedImage: Image(systemName: "car.fill"), lightColor: .green, darkColor: .blue),
                TabButton(selectedImage: Image(systemName: "tram"), unselectedImage: Image(systemName: "tram.fill"), lightColor: .green, darkColor: .blue)
            ])
        }
    }
}

Apps using BetterTabBar

Contributing

Contributions are very welcome 🙌

To submit your changes, please open a Pull Request with a clear description of your changes.

Contributors

Description

  • Swift Tools 5.7.0
View More Packages from this Author

Dependencies

  • None
Last updated: Sat Oct 19 2024 08:29:31 GMT-0900 (Hawaii-Aleutian Daylight Time)