Giter Club home page Giter Club logo

bettertabbar's Introduction

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

bettertabbar's People

Contributors

bircni avatar

Stargazers

Blacky avatar Tanislav avatar Rookie avatar

Watchers

 avatar

Forkers

tnslv

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.