A custom tab bar controller for iOS.

Overview

ESTabBarController

Pod Platform

ESTabBarController is a custom tab bar controller for iOS. It has a tab indicator that moves animated along the bar when switching between tabs. It also provides the capability of running actions associated with the tab bar buttons.

Compatible with iOS 7.0 and above.

Demo

Installation

Simply add ESTabBarController to your Podfile:

pod 'ESTabBarController'

Usage

Initialization

ESTabBarController is initialized with an array of images that represent icons for the buttons in the tab bar:

ESTabBarController *tabBarController = [[ESTabBarController alloc] initWithTabIcons:@[[UIImage imageNamed:@"firstIcon"],
                                                                                      [UIImage imageNamed:@"secondIcon"],
                                                                                      [UIImage imageNamed:@"thirdIcon"]]];

If the images are all loaded from the main bundle, a convenience initializer can be used:

ESTabBarController *tabBarController = [[ESTabBarController alloc] initWithTabIconNames:@[@"firstIcon", @"secondIcon", @"thirdIcon"]];

View controllers

View controllers are set in the way:

[tabBarController setViewController:myFirstViewController
                            atIndex:0];

[tabBarController setViewController:mySecondViewController
                            atIndex:2];

Note that it is possible to have an index without an associated view controller. This can be useful when having a button that performs an action but does not switch to a view controller.

Actions

ESTabBarController allows performing actions when pressing a button in the tab bar:

[tabBarController setAction:^{
    // Perform an action.
} atIndex:1];

If there is also a controller associated with the index for an action, this is performed immediately after switching to the controller.

Highlighted buttons

ESTabBarController allows having highlighted buttons. These are displayed in a different way, and are useful when trying to give more importance to a view controller or action.

[tabBarController highlightButtonAtIndex:1];

Colors

ESTabBarController provides a way to customize two colors:

  • The color of the selected buttons and the selection indicator:
tabBarController.selectedColor = [UIColor redColor]; // Any color.
  • The background color of the buttons:
tabBarController.buttonBackgroundColor = [UIColor grayColor]; // Any color.

Example

More usage information can be found in the Example project.

License

This library is available under the MIT license.

Comments
  • Storyboard ViewControllers?

    Storyboard ViewControllers?

    Instead of the XiB files in your Example app, I tried to create the view controllers in Main.storyboard and connected them to the .h and .m files but, for some reason, when I click the tab bar buttons I can't get to those view controllers. Help please?

    opened by moudallal 9
  • How to change viewController on some tab?

    How to change viewController on some tab?

    At app load, I succesfully init ESTabBarController. Init controllers with: questionsVC *questions = [self.storyboard instantiateViewControllerWithIdentifier:@"questionsVCStory"]; [tabBarController_ setViewController:questions atIndex:1]; When I autorize at someone web-service, I need to change installed viewController to another viewController.

    I try to change like this: newsVC *news = [self.storyboard instantiateViewControllerWithIdentifier:@"newsVCStory"]; [tabBarController_ setViewController:news atIndex:1]; It's worked, but If I go from 1 tab to 3 tab, and will push some viewController (prepareForSegue...) and after that tap on "back", ESTabBarController move me on first tab, where I change before "questionsVC" on "newsVC ". (There I see "newsVC"). So, [tabBarController_ setViewController:news atIndex:1]; worked, but why tabBarController move me on tab, where I change viewController, after popViewController from all other tabs? How to change viewController at index normaly?

    opened by nikitoSha 6
  • Tab bar opacity?

    Tab bar opacity?

    Thanks for sharing this amazing control. It's exactly what I needed. I'm having a bit of an issue. The tab bar isn't 100% the color I set it, it's a bit brighter and I want it to be the exact color, no transparency. Where can I change/fix this? Thanks in advance.

    opened by haleyngonadi 6
  • Landscape Indicator Line

    Landscape Indicator Line

    Hi @ezescaruli

    Thanks for this control I just love it! I recently had to switch one app to landscape mode and this (attached) happens with the separator line. If you click again on any button/index, it will "reset" and work just fine. Any ideas?

    Thank you!

    simulator screen shot may 6 2016 5 11 11 pm

    opened by Krystel 4
  • How to change tabBarItem.badgeValue ?

    How to change tabBarItem.badgeValue ?

    How can I change a badge value of tabItem? I was try: tabBarController_.tabBarController.selectedViewController.tabBarItem.badgeValue = @"23"; But value not changed. Help, please. :)

    opened by nikitoSha 4
  • Update bar Icons

    Update bar Icons

    Is there any way to update the bar icons without re-initializing it? What I mean is that after creating the ESTabBarController instance with its appropriate icon images, at some point in the app i need to switch the order of the icons (RTL - LTR), to achieve that I need to be able to switch the icons.

    Thank you :)

    opened by Krystel 2
  • Knowing when I switched to a new Tab

    Knowing when I switched to a new Tab

    Is it possible to know when I'm in a new View so I can refresh the page. Cause, I've a tableview that I want to reload and fetch data anytime it's switched to. And I also tried to implement NavigationController so I can push to views and also pop views. So, I did this

        tabBarController.setAction({ () -> Void in
            self.navigationController?.popToRootViewControllerAnimated(false)
            }, atIndex: 4)
    

    It didn't work at all

    opened by tonespy 2
  • Navigation Bar?

    Navigation Bar?

    It's me, again. This time I'm having an issue with navigation bars. The project is now converted in Swift so I imported the header files in a bridging header. Every ViewController is instantiated with Storyboard ID and I've embedded in every view controller with a Navigation Controller but none of the navigation bars actually showed up. I tried creating the Navigation Bar programatically but it sucked and it was looking so lame and the Interface Builder way was much better! So, how can I do it? Here's the project: https://github.com/MhTheDev/ESTabBarControllerTest Help?

    opened by moudallal 1
  • Controller should use the correct bundle for loading

    Controller should use the correct bundle for loading

    If you use this library with CocoaPods and use_frameworks!, the pod resources will not be in the main bundle.

    Fix: use bundleForClass: instead of nil for the bundle parameter when loading the XIB.

    https://github.com/CocoaPods/CocoaPods/issues/3226

    opened by lukeredpath 1
  • iPhone X support

    iPhone X support

    This adds support for ESTabBarControler's tabs to be placed over the bottom bar on iPhone X. It looks like this when running the example project on the simulator:

    image

    opened by ezescaruli 0
  • Fix to be able to use the pod with `use_frameworks!`

    Fix to be able to use the pod with `use_frameworks!`

    When initialising the view controller, now use bundleForClass: instead of the main bundle.

    Fixes https://github.com/ezescaruli/ESTabBarController/issues/2.

    opened by ezescaruli 0
  • ESTabBarController is not a kind of UITabBarController iOS 15.2

    ESTabBarController is not a kind of UITabBarController iOS 15.2

    I am facing an issue with ESTabBarController. Below is the error/exception i am getting. Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-tabBarController must return an instance of a UITabBarController subclass. <MMTabViewController: 0x7fb601727d40> returned <ESTabBarController: 0x7fb60688da00>, which is not a kind of UITabBarController.' terminating with uncaught exception of type NSException.

    It would be helpful if you check and revert asap.

    Thanks in advance

    opened by Kiran-3172 0
  • A lot of features

    A lot of features

    Added lots of features , essentially useful for me but I believe would be useful for a lot of other people too. Main Feature list and explanation:

    • indicatorSizeRelativeToIcon - makes the small indicator under the tab, in the same size as the icon.
    • widthPercentages - an array with the size relations between the tabs(if not set, would work like before.Including validation for values here).
    • highlightedBackgroundColor - the background color of the highlighted tab.
    • Theres a ESTabBarDelegate with the function tabClickedTwice which indicates the tab was clicked while it was already selected.(You might need to use the @objc annotation to use it)
    • setIconImageAtIndex - ability to dynamically change the tabs icon

    Thank you and pm if you do not understand anything

    opened by edenfisher 1
  • Add badge label for buttons

    Add badge label for buttons

    I've added an ability to set up badge text for every button and customize this label. I've also added an ability to get current view controllers stack

    opened by GigabyteTheOne 1
Owner
null
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
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
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
Paging view controller and scroll tab view

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

M 1.3k Jan 7, 2023
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
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
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 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

Dylan Marriott 155 Dec 20, 2022
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 134 Jan 5, 2023
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

MindInventory 14 Aug 3, 2022
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

Yuiga Wada 176 Jan 7, 2023
:octocat: AdaptiveController is a 'Progressive Reduction' Swift UI module for adding custom states to Native or Custom iOS UI elements. Swift UI component by @Ramotion

ADAPTIVE TAB BAR 'Progressive Reduction' module for adding custom states to Native or Custom UI elements. We specialize in the designing and coding of

Ramotion 2k Nov 9, 2022
A fully customizable container view controller to display a set of ViewControllers in a horizontal scroll view. Written in Swift.

DTPagerController This is a control for iOS written in Swift. DTPagerController is simple to use and easy to customize. Screenshots Default segmented

Tung Vo 290 Nov 13, 2022
ℒ️ A powerful paging view controller with interactive indicator bars

⭐️ Features Easy to implement page view controller with interactive indicator bars. Highly adaptable and powerful customization. Fully extensible with

UI At Six 2.5k Jan 2, 2023
Custom segmented picker for SwiftUI

Custom segmented picker for SwiftUI

Sergey Kazakov 34 Dec 27, 2022
A custom ViewPager title strip which gives continuous feedback to the user when scrolling

SmartTabLayout A custom ViewPager title strip which gives continuous feedback to the user when scrolling. This library has been added some features an

ogaclejapan 7k Dec 30, 2022