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

Related tags

Tab Bar GGTabBar
Overview

GGTabBar

GGTabBar is a simple UITabBar & UITabBarController replacement that uses Auto Layout for constructing the GUI. I created it for curiosity, but it may be useful to others who adventure into the land of Auto Layout.

Build Status

screenshot

⚠️ This is a work in progress/proof of concept, I'm no expert. Sorry if it's missing some feature you need, feel free to fork, pull request or open issues. I'm available on Twitter if you have further questions 😬 πŸ‘Œ

Limitations πŸ’£

  • Still need to add customization options (background color, tint, style, background image, etc.).
  • The tab bar items are UIButtons (no TabBarItem abstraction in a UIView).
  • No more tab if you add more than 5 View Controllers.
  • Still need to add more integration tests.

Install

CocoaPods

pod 'GGTabBar', '~> 0.0.2'

Xcode

Just copy the GGTabBar folder into your Xcode project.

Usage πŸš€

⚠️ Your UIViewControllers must set their tabBarItem images (selected/normal).

Objective-C

Init and customize

GGTabBarController *tabBar = [[GGTabBarController alloc] init];
tabBar.tabBarAppearanceSettings = @{kTabBarAppearanceHeight : @(100.0)}; // in points
tabBar.viewControllers = @[vc1, vc2, vc3, vc4];
self.window.rootViewController = tabBar;

Swift

⚠️ remember to add GGTabBar.h into your project's Swift Bridging Header.

var tabBar: GGTabBarController = GGTabBarController()
tabBar.tabBarAppearanceSettings = [kTabBarAppearanceHeight : 100.0];
tabBar.viewControllers = [vc1, vc2, vc3, vc4]
self.window!.rootViewController = tabBar

⚠️ Feel free to explore the provided Example Project to check out how to use GGTabBar.

Structure 🍷

All the views are setup with Auto Layout. There are no CGRect, Struts or Sprints, so unless you break the constraints, everything should work on different screen-sizes.

If you want more information about how the AutoLayout Constraints are specified, please take a look at the tests. It's the best way to understand what's going on here.

hierarchy

Debug πŸ›

Normally you won't be doing any sort of Debug, but it something strange happens you can enable debugMode so that all the UIView's backgrounds are painted.

To enable debug mode:

Objective-C

tabBar.debug = YES;

Swift

tabBar.debug = true
  • Green Views: Margins, there are always exactly two of them.
  • Red Views: Separators, located between buttons.
  • Blue View: The GGTabBar.view.
  • White Views: Button backgrounds.

Emoji πŸ’©

You got to freakin' ❀️ them 😁 !

You might also like...
πŸ“± 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

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

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 minimal tab bar alternative
πŸ“± A minimal tab bar alternative

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

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

Swipeable Views with Tabs (Like Android SwipeView With Tabs Layout)
Swipeable Views with Tabs (Like Android SwipeView With Tabs Layout)

SMSwipeableTabView [![CI Status](http://img.shields.io/travis/Sahil Mahajan/SMSwipeableTabView.svg?style=flat)](https://travis-ci.org/Sahil Mahajan/SM

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

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

Comments
  • Fix broken headings in Markdown files

    Fix broken headings in Markdown files

    GitHub changed the way Markdown headings are parsed, so this change fixes it.

    See bryant1410/readmesfix for more information.

    Tackles bryant1410/readmesfix#1

    opened by bryant1410 1
  • Correct the spelling of CocoaPods in README

    Correct the spelling of CocoaPods in README

    This pull requests corrects the spelling of CocoaPods πŸ€“ https://github.com/CocoaPods/shared_resources/tree/master/media

    Created with cocoapods-readme.

    opened by ReadmeCritic 0
  • SelectedIndex is not being used anywhere in project

    SelectedIndex is not being used anywhere in project

    Hi, There is no use of SelectedIndex in GGTabBarController it always will be 0

    I did changed SelectedIndex in my project in delegate method

    - (void)tabBar:(GGTabBar *)tabBar didPressButton:(UIButton *)button atIndex:(NSUInteger)tabIndex
    

    Please change them in your project as well to give this index right value.

    opened by jasminpethani 1
Owner
Nicolas Goles
Software Craftsman, Wine Enthusiast & Amateur Pianist. Mostly doing iOS but you can find traces of my crappy bash, python & ruby code here and there 🍷
Nicolas Goles
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

Yalantis 3.7k Dec 21, 2022
UITabBarController with swipe interaction between its tabs.

?? Features Zero setup Different animations Enable/Disable interactions easily Fluid gestures ?? Installation Using CocoaPods Edit your Podfile and sp

Marcos Griselli 1.4k Jan 7, 2023
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
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
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
ESTabBarController is a highly customizable TabBarController component, which is inherited from UITabBarController.

ESTabBarController is a highly customizable TabBarController component, which is inherited from UITabBarController. Why? In real-world developmen

Vincent Li 4.9k Jan 5, 2023
ExpandedTabBar is a very creative designed solution for "more" items in UITabBarController

ExpandedTabBar is a very creative designed solution for "more" items in UITabBarController. It's greate experience to have more comfortable and intuitive UI.

Yervand Saribekyan, iOS Dev 256 Nov 1, 2022
A subclass of UITabBarController that translates UITabBarItems 1:1 into a Sidebar on iPadOS.

FredKitTabBarSplitView A subclass of UITabBarController that translates UITabBarItems 1:1 into a Sidebar on iPadOS. Simply use FredKitTabBarSplitView

Frederik Riedel 9 Jan 12, 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