Coder Social home page Coder Social logo

mightytabbar's Introduction

Build Status CocoaPods Carthage Compatible Swift v4 Contributors MIT License Twitter


Logo

MightyTabBar is a customizable tab bar that doubles as a menu drawer. Instead of being limited to 5 tab bar items, MightyTabBar allows your app to have many more tab bar items, all positioned within the thumb zone and easily accessible via swipe up.

The original tab bar has always been one of the best UI controls for navigation. It's simple, clear and easy to reach on a mobile device. However, one of the main issues with it is the limited space it affords. The current solution uses a 'More...' tab item to reveal a list of additional menu items, often on another screen. Another solution has been the dreaded hamburger menu, of which there have been many, many, many articles written about it.

MightyTabBar is a simple solution to this. It uses a UI element which we are all familliar with (the tab bar) and combines it with another UI element we've probably come across before - the card or drawer UI. Drawers are used in apps like Music, Maps and Uber to display more information about an activity in the main view. Combining the tab bar and drawer allows MightyTabBar to have the best of both worlds - a simple, familliar navigation control which can be expanded to show additional tab bar items.

Some ideas for the future of MightyTabBar:

  • Allow drag and drop to reposition tab bar items
  • Indicators for selected tab bar items below the fold
  • Support UIVisualEffectView for the background
  • Better iPad support
  • Better horizontal layout support
  • Testing! ๐Ÿ˜…
  • Refactor to use SwiftUI

As always, if you like where this project is going, please feel free to suggest new features, fixes, improvements and maybe even contribute if you can!

Table of Contents

Screenshots

Product Name Screen Shot Product Name Screen Shot

Getting Started

Follow the instructions below to get started.

Requirements

  • Xcode 10 or later
  • iOS 10.0 or later
  • Swift 4 or later

Demo

Run pod install in the MightTabBarExample folder. Open the MightyTabBarExample workspace. Build and run.

Installation

CocoaPods

pod MightyTabBar

Carthage

github "timshim/MightyTabBar"

Manually

git clone https://github.com/timshim/MightyTabBar.git

Usage

Setup

This example initializes MightyTabBar in didFinishLaunching method in AppDelegate:

window = UIWindow(frame: UIScreen.main.bounds)

// Initialize MightyTabBar
let tabBarController = MightyTabBarController()

// MightyTabBar configuration
tabBarController.itemCountInRow = 4 // Number of tab bar items on each row
tabBarController.bgColor = .white // Background color of the tab bar
tabBarController.handleColor = UIColor(displayP3Red: 149/255, green: 165/255, blue: 166/255, alpha: 0.5) // Color of the drag handle
tabBarController.selectedColor = .red // Set highlighted color
tabBarController.deselectedColor = .black // Set normal color

// Add the tab bar items as an array of dictionary with keys "name" and "image"
tabBarController.tabBarItems = [
    ["name": "Home", "image": "home"],
    ["name": "Explore", "image": "rocket"],
    ["name": "Camera", "image": "camera"],
    ["name": "Gift", "image": "gift"],
    ["name": "Settings", "image": "gear"],
    ["name": "Award", "image": "gift"],
    ["name": "Profile", "image": "home"],
    ["name": "Gear", "image": "gear"],
    ["name": "Discover", "image": "rocket"],
    ["name": "Photos", "image": "camera"]
]

// Add the ViewControllers for each item
let vc01 = ViewController01()
let vc02 = ViewController02()
let vc03 = ViewController03()
let vc04 = ViewController04()
let vc05 = ViewController05()
let vc06 = ViewController06()
let vc07 = ViewController07()
let vc08 = ViewController08()
let vc09 = ViewController09()
let vc10 = ViewController10()
tabBarController.viewControllers = [vc01, vc02, vc03, vc04, vc05, vc06, vc07, vc08, vc09, vc10]

window?.rootViewController = tabBarController
window?.makeKeyAndVisible()

Badge

Set a badge count by calling setBadge(count: Int, index: Int). Set count to 0 to remove it.

tabBarController.setBadge(count: 1, index: 0)

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature)
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Tim Shim - @timshim - [email protected]

Acknowledgements

mightytabbar's People

Contributors

timshim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mightytabbar's Issues

SwiftUI version?

If nobody is working on making this work with SwiftUI, I might go ahead and do it. This would be perfect for my app.

Not working in iOS 13+

Hi, dev I'm currently using MightyTabBar as per my requirements, it's working fine in below iOS 13 but in devices iOS 13 and above tabBar not working properly. Expanding functionality is not working in iOS 13 as same as other iOS version

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.