πŸ“± A minimal tab bar alternative

Overview

Swift Version Version License twitter: @dylan36032

MiniTabBar

A clean simple alternative to the UITabBar. Only shows the title when being tapped on. Gives the app a way cleaner look :)

Requirements

  • iOS 10.0+
  • Xcode 8

Installation

CocoaPods:

You can use CocoaPods to install MiniTabBar by adding it to your Podfile:

pod 'MiniTabBar'

Manually

Drag and drop MiniTabBar.swift and MiniTabBarItemView.swift into your project.

Usage

// First create some tab bar items:
// Icons should be a template image with the size 26 x 20 dp
var items = [MiniTabBarItem]()
items.append(MiniTabBarItem(title: "Tab Name", icon: <UIImage>))
//...

// Create a MiniTabBar instance and add it as a regular subview:
let tabBar = MiniTabBar(items: items)
tabBar.translatesAutoresizingMaskIntoConstraints = false
tabBar.delegate = self
self.view.addSubview(tabBar)

let constraints = [
	tabBar.bottomAnchor.constraint(equalTo: view.layoutMarginsGuide.bottomAnchor),
	tabBar.widthAnchor.constraint(equalTo: view.widthAnchor),
	tabBar.heightAnchor.constraint(equalToConstant: 44),
]
NSLayoutConstraint.activate(constraints)

// Delegate protocol:
func tabSelected(_ index: Int) {
	print("Selected tab: ", index)
}

Costumization

Here are some ways to customize the look of the MiniTabBar:

// Change the tint colour of an item (title & icon):
tabBar.tintColor = UIColor.red

// Change the font of the title label:
tabBar.font = UIFont.systemFont(ofSize: 10)

// Select an item programmatically: 
tabBar.selectItem(2, animated: false)

// Change the background & key line of the tab bar:
tabBar.backgroundColor = UIColor.black
tabBar.backgroundBlurEnabled = false
tabBar.keyLine.isHidden = true

Custom View

It's also possible to have a custom view that doesn't act like a tab. For example a (+) button in the middle.

let customButton = UIButton()
customButton.backgroundColor = UIColor.orange
customButton.frame.size = CGSize(width: 50, height: 50)
let customItem = MiniTabBarItem(customView: customButton, 
                                    offset: UIOffset(horizontal: 0, 
                                                       vertical: -10))
customItem.selectable = false
items.append(customItem)
You might also like...
Aesthetic floating tab bar ––– SwiftUI & Combine ⛓️ Importable via Swift Package Manager πŸ“¦
Aesthetic floating tab bar ––– SwiftUI & Combine ⛓️ Importable via Swift Package Manager πŸ“¦

FloatingTabBar An aesthetic floating tab bar made with SwiftUI & Combine importabable via Swift Package Manager πŸ“¦ Based off BottomBar-SwiftUI Preview

A flexible TabBarController with search tab like SNKRS.
A flexible TabBarController with search tab like SNKRS.

PolioPager PolioPager is the easiest way to use PagerTabStrip including search tab in iOS. Written in pure swift. (ζ—₯本θͺžγ―こけら) Comparison SNKRS ↓↓↓↓ Poil

Paging view controller and scroll tab view
Paging view controller and scroll tab view

TabPageViewController Description TabPageViewController is paging view controller and scroll tab view. Screenshot Infinity Mode Limited Mode Customiza

iOS Top Tab Navigation
iOS Top Tab Navigation

iOS-Top-Tab-Navigation Good news for all our users out there! Now there are no boundaries to your convenience, you can pass as much words as you want

Folding Tab Bar and Tab Bar Controller
Folding Tab Bar and Tab Bar Controller

FoldingTabBar.iOS Folding Tab Bar and Tab Bar Controller Inspired by this project on Dribbble Also, read how it was done in our blog Requirements iOS

Easily hide and show a view controller's navigation bar (and tab bar) as a user scrolls
Easily hide and show a view controller's navigation bar (and tab bar) as a user scrolls

HidingNavigationBar An easy to use library (written in Swift) that manages hiding and showing a navigation bar as a user scrolls. Features Usage Custo

A fun, easy-to-use tab bar navigation controller for iOS.
A fun, easy-to-use tab bar navigation controller for iOS.

CircleBar Don’t you, sometimes, miss fun user interfaces? Truth is, we do. Sure, you can't use them in enterprise apps for obvious reasons, but if you

Different Styles of Custom Tab Bar
Different Styles of Custom Tab Bar

LightCardTabBar An expiremental project exploring different types of custom-tabbar styles, screenshots as below. Screenshots Implementation The implem

Simplistic & unfinished recreation of MobileSafari's tab bar
Simplistic & unfinished recreation of MobileSafari's tab bar

SafariTabBar This is a simplistic recreation of the MobileSafari tab bar on iPad (prior to iPadOS 15). It is also very unfinished, and not intended in

πŸ“± TabBar – highly customizable tab bar for your SwiftUI application.
πŸ“± TabBar – highly customizable tab bar for your SwiftUI application.

TabBar SwiftUI standard TabView component is not so flexible and to customize it you have to modify appearance proxy of UITabBar or implement your own

A fun, easy-to-use tab bar navigation controller for iOS.
A fun, easy-to-use tab bar navigation controller for iOS.

CircleBar Don’t you, sometimes, miss fun user interfaces? Truth is, we do. Sure, you can't use them in enterprise apps for obvious reasons, but if you

Aesthetic floating tab bar ––– SwiftUI & Combine ⛓️ Importable via Swift Package Manager πŸ“¦
Aesthetic floating tab bar ––– SwiftUI & Combine ⛓️ Importable via Swift Package Manager πŸ“¦

FloatingTabBar An aesthetic floating tab bar made with SwiftUI & Combine importabable via Swift Package Manager πŸ“¦ Based off BottomBar-SwiftUI Preview

A prototype of custom tab bar using SwiftUI with techniques of mask + matchedGeometryEffect
A prototype of custom tab bar using SwiftUI with techniques of mask + matchedGeometryEffect

SliderTabBar A prototype of custom tab bar using SwiftUI with techniques of mask

A custom tab bar controller for iOS.
A custom tab bar controller for iOS.

ESTabBarController ESTabBarController is a custom tab bar controller for iOS. It has a tab indicator that moves animated along the bar when switching

Another UITabBar & UITabBarController (iOS Tab Bar) replacement, but uses Auto Layout for arranging it's views hierarchy.
Another UITabBar & UITabBarController (iOS Tab Bar) replacement, but uses Auto Layout for arranging it's views hierarchy.

GGTabBar GGTabBar is a simple UITabBar & UITabBarController replacement that uses Auto Layout for constructing the GUI. I created it for curiosity, bu

Emoji Tab Bar button badges ✨

SuperBadges Add emojis and colored dots as badges for your Tab Bar buttons ✨ Usage Add an emoji badge: YourTabBarController.addDotAtTabBarItemIndex(

A custom tab bar controller for iOS written in Swift 4.2
A custom tab bar controller for iOS written in Swift 4.2

A custom tab bar controller for iOS written in Swift 4.0 Screenshots Installation Cocoa Pods: pod 'AZTabBar' Swift Package Manager: You can use The Sw

Aesthetic floating tab bar ––– SwiftUI & Combine ⛓️ Importable via Swift Package Manager πŸ“¦
Aesthetic floating tab bar ––– SwiftUI & Combine ⛓️ Importable via Swift Package Manager πŸ“¦

FloatingTabBar An aesthetic floating tab bar made with SwiftUI & Combine importabable via Swift Package Manager πŸ“¦ Based off BottomBar-SwiftUI Preview

A drop-in universal library helps you to manage the navigation bar styles and makes transition animations smooth between different navigation bar styles
A drop-in universal library helps you to manage the navigation bar styles and makes transition animations smooth between different navigation bar styles

A drop-in universal library helps you to manage the navigation bar styles and makes transition animations smooth between different navigation bar styles while pushing or popping a view controller for all orientations. And you don't need to write any line of code for it, it all happens automatically.

Comments
  • Better README

    Better README

    Hey, your library is really interesting.

    The only problem I found was the README.md, which lacks information. I created this iOS Open source Readme Template so you can take a look on how to better organize. If you want, I can help you to do it.

    What are your thoughts?

    opened by lfarah 3
  • Enhancement

    Enhancement

    Hi,

    Love this small library thanks for this work! Do you plan to implement new features? Those ones would be great:

    • Add badge / notification to an item
    • Allow to keep the text on the bottom of an item when selected (like this library in android with "title states"
    • Smooth hide/show transition
    opened by rhanb 2
  • use without custom view

    use without custom view

    Hi how are you D? i want use your library from my app , and i want use default ios tab bar with mini tabbar animate , but your library have a custom view and how can i use this ? i need just your animation tabbar item when tuch , for my tabbar screen shot 2017-05-27 at 12 15 29 pm

    opened by AmirDaliri 1
Owner
Dylan Marriott
Software Engineer
Dylan Marriott
A fun, easy-to-use tab bar navigation controller for iOS.

CircleBar Don’t you, sometimes, miss fun user interfaces? Truth is, we do. Sure, you can't use them in enterprise apps for obvious reasons, but if you

softhaus 786 Dec 25, 2022
Different Styles of Custom Tab Bar

LightCardTabBar An expiremental project exploring different types of custom-tabbar styles, screenshots as below. Screenshots Implementation The implem

Hussein Ryalat 31 Dec 23, 2022
Simplistic & unfinished recreation of MobileSafari's tab bar

SafariTabBar This is a simplistic recreation of the MobileSafari tab bar on iPad (prior to iPadOS 15). It is also very unfinished, and not intended in

Steven Troughton-Smith 51 Oct 26, 2022
πŸ“± TabBar – highly customizable tab bar for your SwiftUI application.

TabBar SwiftUI standard TabView component is not so flexible and to customize it you have to modify appearance proxy of UITabBar or implement your own

Tamerlan Satualdypov 162 Jan 5, 2023
Aesthetic floating tab bar ––– SwiftUI & Combine ⛓️ Importable via Swift Package Manager πŸ“¦

FloatingTabBar An aesthetic floating tab bar made with SwiftUI & Combine importabable via Swift Package Manager ?? Based off BottomBar-SwiftUI Preview

10011.co 135 Jan 8, 2023
A prototype of custom tab bar using SwiftUI with techniques of mask + matchedGeometryEffect

SliderTabBar A prototype of custom tab bar using SwiftUI with techniques of mask

Ka Kui 1 Dec 24, 2021
A custom tab bar controller for iOS.

ESTabBarController ESTabBarController is a custom tab bar controller for iOS. It has a tab indicator that moves animated along the bar when switching

null 122 Oct 6, 2022
Another UITabBar & UITabBarController (iOS Tab Bar) replacement, but uses Auto Layout for arranging it's views hierarchy.

GGTabBar GGTabBar is a simple UITabBar & UITabBarController replacement that uses Auto Layout for constructing the GUI. I created it for curiosity, bu

Nicolas Goles 157 Sep 26, 2022
Emoji Tab Bar button badges ✨

SuperBadges Add emojis and colored dots as badges for your Tab Bar buttons ✨ Usage Add an emoji badge: YourTabBarController.addDotAtTabBarItemIndex(

Oded Harth 55 Dec 13, 2021
A custom tab bar controller for iOS written in Swift 4.2

A custom tab bar controller for iOS written in Swift 4.0 Screenshots Installation Cocoa Pods: pod 'AZTabBar' Swift Package Manager: You can use The Sw

Antonio Zaitoun 335 Dec 11, 2022