ESTabBarController is a highly customizable TabBarController component, which is inherited from UITabBarController.

Overview

ESTabBarController

SwiftPM compatible Carthage Compatible CocoaPods Swift v5 Twitter Twitter Chat Gitter.im

中文介绍

ESTabBarController is a highly customizable TabBarController component, which is inherited from UITabBarController.

Why?

In real-world development, we may encounter the situation that customizing the UITabBar. For instance: change font style, add animation, use bigger item. However it's hard to do with UITabBarItem.

With ESTabBarController, You can easily achieve these!

- Feature Description
1 Default style You can get system-like style by initializing the TabBar with ESTabBarController directly.

UITabBarController style:

System native style

ESTabBarController default style:

ES system-like style
2 Default style with "More" item If the items are more than the maximum number of displays, there will be a "More" item.

UITabBarController with "More":

enter image description here

ESTabBarController with "More":

enter image description here
3 Mix UITabBarItem and ESTabBarItem You can set any item as you want, including UITabBarItem and ESTabBarItem.

ESTabBar and UITabBar mixed style:

enter image description here

ESTabBar and UITabBar mixed style with "More":

enter image description here
4 UIKit attributes ESTabBarController is compatible with UITabBarController, UITabBar and UITabBarItem's most API attributes. You can migrate to ESTabBarController without any modification of the origin code.

Compatible with UITabBarController's selectedIndex:

enter image description here
5 Any nesting with UINavigationController Developing withUITabBarController, there are two common ways to handle layers:

First :

├── UITabBarController

└──── UINavigationController

└────── UIViewController

└──────── SubviewControllers

Second :

├── UINavigationController

└──── UITabBarController

└────── UIViewController

└──────── SubviewControllers

In the first case, need to set hidesBottomBarWhenPushed = true when pushing subViews. The second is not.

In ESTabBarController, add Container views to UITabBar to be compatible with these two ways。
6 Customizable style With ESTabBarController, you can:

1. Customize selected item's color and style:

enter image description here

2. Add selecting animation:

enter image description here

3. Customize item's background color:

enter image description here

4. Add highlight animation:

enter image description here

5. Add animation to prompt users:

enter image description here

6. And much more ...

7 Customizable item's size

Customizable click event
You can easily customize item's size using ESTabBarController.

When the button's frame is larger than TabBar, through the use of HitTest to achieve making outer TabBar area click valid.

In addition, ESTabBarController can customize click event, and through a block to callback super-layer to handle.

With big item in the middle of TabBar:

enter image description here

With a special hint style:

enter image description here

Customize click event:

enter image description here
8 Default notification style You can get system-like notification style by initializing the TabBar with ESTabBarController directly.

UITabBarController notification style:

enter image description here

ESTabBarController system-like notification style:

enter image description here
9 Customizable notification style With ESTabBarController, you can:

1. Customize notification animation:

enter image description here

enter image description here

2. Customize prompt style:

enter image description here

3. And much more ...

10 Lottie Through customizing ContentView, you are able to add Lottie's LAAnimationView to Item(s)

enter image description here

Requirements

  • Xcode 8 or later
  • iOS 8.0 or later
  • ARC
  • Swift 5 or later

Demo

You can download and build ESTabBarControllerExample project, and you will find more examples to use ESTabBarController, and also more examples to customize UITabBar。

Usage

CocoaPods

pod "ESTabBarController-swift"

Carthage

github "eggswift/ESTabBarController"

Manually

git clone https://github.com/eggswift/ESTabBarController.git
open ESTabBarController

TODO

  1. The Containers' layout is purely based on code,using Autolayout will be better.
  2. When there is "More", if edit it will occurs problem.
  3. Partial UITabBarItem attributes are not bridge to ESTabBarItem.
  4. The picture of 'More' item in ESTabBarItemMoreContentView is not set into framework, plan to convert it to CGBitmap.

Sponsor

You can support the project by checking out our sponsor page. It takes only one click:

git-ad
This advert was placed by GitAds

Acknowledgement

About

ESTabBarController is developed and maintained by Vincent Li. If you have any questions or issues in using ESTabBarController, welcome to issue.
If you want to contribute to ESTabBarController, Please submit Pull Request, I will deal with it as soon as possible.

Twitter URL Twitter Follow

License

The MIT License (MIT)

Copyright (c) 2013-2016 eggswift. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Issues
  • 请问这个插件在swift4里面怎么用...

    请问这个插件在swift4里面怎么用...

    复制了viewcontroller它也报错... 三个全复制了它还报错... 新手..求助

    opened by yoyo0926 21
  • Can't run the example project on simulator

    Can't run the example project on simulator

    I download the example project but can't run it. It just said "Build Succeed" but it doesn't launch into simulator or device. Please help

    opened by DKPham 14
  • Icons became very small after upgrading from 2.5 to 2.6.1

    Icons became very small after upgrading from 2.5 to 2.6.1

    Hi, I am using this library in my project and after updating from version 2.5 to 2.6.1 I've noticed that the tab icons size has changed and now they are very small. My tab bar design is image only. Each icon size is 40x40. I wanted to know if this change is by design or it's a bug?

    Thanks!

    opened by ranhsd 13
  • Safe Area

    Safe Area

    Support for the Safe Area? screen shot 2017-10-04 at 21 17 35

    opened by taglia3 12
  • Instructions to install

    Instructions to install

    How can I add ESTabBarController to my project?

    opened by pableiros 11
  • tabbar frame bug in iOS 12.1 beta 2

    tabbar frame bug in iOS 12.1 beta 2

    2421538966387_ pic It doesn't appear in former system versions. Maybe it's a system bug of this beta system...

    opened by xiaoxiongke 10
  • 在iOS13 上 tabbar 上面有一条黑线

    在iOS13 上 tabbar 上面有一条黑线

    在iOS13 上 tabbar 上面有一条黑线

    opened by findM 8
  • iPhoneX push 偏移问题

    iPhoneX push 偏移问题

    在 push 后 tabbar 的 frame 会发生变化

    opened by hydyy 8
  •  Default first item animation issue

    Default first item animation issue

    If I set selectedIndex = 2 in viewDidLoad function of Tabbar Controller, when first open App , first item and third item will both show select animation. So if I want to just show third item animation.How can I do? Please help me, thanks!

    code:

     class CustomTabbarController: ESTabBarController {
        override func viewDidLoad() {
            super.viewDidLoad()
            
            if let tabBar = self.tabBar as? ESTabBar {
                tabBar.itemCustomPositioning = .fillIncludeSeparator
            }
            
            let v1 = UIViewController()
            let v1Nav = UINavigationController(rootViewController: v1)
            
            let v2 = UIViewController()
            let v2Nav = UINavigationController(rootViewController: v2)
            
            let v3 = UIViewController()
            let v3Nav = UINavigationController(rootViewController: v3)
            
            let v4 = UIViewController()
            let v4Nav = UINavigationController(rootViewController: v4)
            
            let v5 = UIViewController()
            let v5Nav = UINavigationController(rootViewController: v5)
            
            v1Nav.tabBarItem = ESTabBarItem.init(...)
            v2Nav.tabBarItem = ESTabBarItem.init(...)
            v3Nav.tabBarItem = ESTabBarItem.init(...)
            v4Nav.tabBarItem = ESTabBarItem.init(...)
            v5Nav.tabBarItem = ESTabBarItem.init(...)
            
            self.viewControllers = [v1Nav, v2Nav, v3Nav, v4Nav, v5Nav]
            
            selectedIndex = 2
        }
    }  
    
    class TabBarContentView: ESTabBarItemContentView {
    
        public var duration = 0.3
        override init(frame: CGRect) {
            super.init(frame: frame)
            highlightTextColor = UIColor.hex(hexStr: GREEN, alpha: 1)
            renderingMode = .alwaysOriginal
        }
        
        public required init?(coder aDecoder: NSCoder) {
            fatalError("init(coder:) has not been implemented")
        }
        
        override func selectAnimation(animated: Bool, completion: (() -> ())?) {
            self.bounceAnimation()
            completion?()
        }
        
        override func reselectAnimation(animated: Bool, completion: (() -> ())?) {
            self.bounceAnimation()
            completion?()
        }
        
        func bounceAnimation() {
            let impliesAnimation = CAKeyframeAnimation(keyPath: "transform.scale")
            impliesAnimation.values = [1.0 ,1.4, 0.9, 1.15, 0.95, 1.02, 1.0]
            impliesAnimation.duration = duration * 2
            impliesAnimation.calculationMode = kCAAnimationCubic
            imageView.layer.add(impliesAnimation, forKey: nil)
        }
    
    }
    
    
    opened by huaqixue 8
  • Lottie无效果

    Lottie无效果

    image image image

    这个地方是引入自定义lottie的地方,但是没看到有add这个操作,而且还没有触发点击效果

    image 执行方法后发现这个地方自定义的动画View根本没添加进来,请教下怎么解决

    opened by bruceFighting 0
  • 如何在tabbar顶部加自定义线

    如何在tabbar顶部加自定义线

    null

    opened by ZClee128 0
  • 2.9.0在cocoapods.org无法找到,iOS15显示与14相比略有不同

    2.9.0在cocoapods.org无法找到,iOS15显示与14相比略有不同

    目前通过pod安装的是2.8版本,2.9无法安装。 安装在iOS14和iOS15相比,ios15比iOS14顶部少了一根分割线,不知是我个人页面排版导致还是ESTabBarController 适配导致。 期待修复

    opened by beiguancyc 0
  • How to show bottom TabBar on all pushed VC

    How to show bottom TabBar on all pushed VC

    This code is on ViewController not on AppDelegate

     let v1 = self.storyboard?.instantiateViewController(withIdentifier: "Temp1ViewController") as! Temp1ViewController
            let v2 = self.storyboard?.instantiateViewController(withIdentifier: "TaskVC") as! TaskVC
            let v3 = self.storyboard?.instantiateViewController(withIdentifier: "Temp1ViewController") as! Temp1ViewController
            let v4 = self.storyboard?.instantiateViewController(withIdentifier: "Temp1ViewController") as! Temp1ViewController
            let v5 = self.storyboard?.instantiateViewController(withIdentifier: "Temp1ViewController") as! Temp1ViewController
            
            
            v1.tabBarItem = ESTabBarItem.init(TabBarContentView(), title: "Home", image: UIImage(named: "home"), selectedImage: UIImage(named: "home2"))
            v2.tabBarItem = ESTabBarItem.init(TabBarContentView(), title: "Screen2", image: UIImage(named: "Screen2"), selectedImage: UIImage(named: "Screen2"))
            v3.tabBarItem = ESTabBarItem.init(TabBarContentView(), title: "Screen3", image: UIImage(named: "Screen3"), selectedImage: UIImage(named: "Screen3"))
            v4.tabBarItem = ESTabBarItem.init(TabBarContentView(), title: "Screen4", image: UIImage(named: "Screen4"), selectedImage: UIImage(named: "Screen4"))
            v5.tabBarItem = ESTabBarItem.init(TabBarContentView(), title: "Screen5", image: UIImage(named: "Screen5"), selectedImage: UIImage(named: "Screen5"))
            
            
            self.delegate = self
            self.viewControllers = [v1,v2,v3,v4,v5]
    
    
    
    
    opened by jis248 0
  • Navigation bar height error when i pushViewController from tabBarController at the first time run app

    Navigation bar height error when i pushViewController from tabBarController at the first time run app

    I have an issue that when the first time i run build the app (Only the first time, remove app and run build): The navigation bar height is smaller when i pushViewController from tabBarController. VC1(ESTabBarController) ---push---> VC2(UIViewController) : Error Occurred VC1(UIViewController of ESTabBarController) --push--> VC2(UIViewController) : OK

    The error occurred only when the first time build app, when kill the app and open again, everything is ok.

    I dont know which caused this error, ESTabbar or OS or statusBar ..

    The navigation bar is smaller here IMG_0424

    Kill app and open again, things is good. IMG_0425

    Please help me, thank you so much!

    opened by chanhdatng 1
  • 下载的代码包无法在xcode 12.4中运行

    下载的代码包无法在xcode 12.4中运行

    下载zip包,在Xcode12.4中运行,Lottie.framework 和pop.framework找不到

    把Lottie和pop去掉以后运行报错:

    dyld: launch, loading dependent libraries DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib

    麻烦博主更新一下

    opened by xiaopindev 2
  • How to set custom image in tab bar item?

    How to set custom image in tab bar item?

    I am using sd_web_image to try and set user's profile photo as tab bar item (image). Why can't we do this? It doesn't work when I try...

    opened by cvcoder1 0
  • 怎么设置透明背景

    怎么设置透明背景

    怎么设置透明背景 我把backimage 设置为空的不可用

    opened by ZWBNice 0
  • selectedIndex、selectedViewController设置bug反馈

    selectedIndex、selectedViewController设置bug反馈

    通过调用selectedIndex、selectedViewController进行页面设置时,若shouldHijackHandler返回为true,由于selectedIndex、selectedViewController会默认调用父类UITabbarController的该属性(比如:selectedIndex=3),导致tabbar未选中3,但controller已切换到了3。

    opened by ethancheung1990 0
  • fix Example projects compile error on Xcode 12.3 or above

    fix Example projects compile error on Xcode 12.3 or above

    workaround for https://developer.apple.com/forums/thread/669274

    opened by DayBySay 0
Owner
Vincent Li
Life is brief, and then you die, you know?
Vincent Li
WLEmptyState is an iOS based component that lets you customize the view when the dataset of a UITableView or a UICollectionView is empty. We created a sample project with the WLEmptyState component to show how you can use it.

Table of Content Overview Running an Example Project Installing WLEmptyState Configuring WLEmptyState Using WLEmptyState Customizing WLEmptyState Cont

Wizeline 311 Nov 23, 2021
Easy to use, highly customizable gauge view

GDGauge - Customizable Gauge View Requirements Xcode 11+ Swift 5 iOS 9+ Installation Swift Package Manager .package(url: "https://github.com/saeid/GDG

Saeid Basirnia 68 Oct 14, 2021
Simple and highly customizable iOS tag list view, in Swift.

TagListView Simple and highly customizable iOS tag list view, in Swift. Supports Storyboard, Auto Layout, and @IBDesignable. Usage The most convenient

Ela Workshop 2.3k Nov 15, 2021
Highly customizable Action Sheet Controller with Assets Preview written in Swift

PPAssetsActionController Play with me ▶️ ?? If you want to play with me, just tap here and enjoy! ?? ?? Show me ?? Try me ?? The easiest way to try me

Pavel Pantus 71 Aug 7, 2021
Simple and highly customizable iOS tag list view, in Swift.

TagListView Simple and highly customizable iOS tag list view, in Swift. Supports Storyboard, Auto Layout, and @IBDesignable. Usage The most convenient

Ela Workshop 2.3k Nov 18, 2021
The easiest way to display highly customizable in app notification banners in iOS

Written in Swift 5 NotificationBanner is an extremely customizable and lightweight library that makes the task of displaying in app notification banne

Dalton Hinterscher 4.3k Nov 24, 2021
A paging view controller with a highly customizable menu ✨

Getting Started | Customization | Installation Features Parchment lets you page between view controllers while showing any type of generic indicator t

Martin Rechsteiner 2.8k Nov 12, 2021
Highly customizable alertview and alert/notification/success/error/alarm popup written in Swift

CDAlertView is highly customizable alert popup written in Swift. Usage is similar to UIAlertController. Screenshots Animations Usage Basic usage witho

Candost Dagdeviren 1.1k Nov 12, 2021
Highly customizable Action Sheet Controller with Assets Preview written in Swift

PPAssetsActionController Play with me ▶️ ?? If you want to play with me, just tap here and enjoy! ?? ?? Show me ?? Try me ?? The easiest way to try me

Pavel Pantus 71 Aug 7, 2021
Customizable CheckBox / RadioButton component for iOS

GDCheckbox An easy to use CheckBox/Radio button component for iOS, with Attributes inspector support. Requirements Xcode 10+ Swift 5 iOS 9+ Installati

Saeid Basirnia 25 Feb 1, 2021
An easy to use UI component to help display a signal bar with an added customizable fill animation

TZSignalStrengthView for iOS Introduction TZSignalStrengthView is an easy to use UI component to help display a signal bar with an added customizable

TrianglZ LLC 22 Jun 3, 2021
A simple, highly customisable, data-driven 3D carousel for iOS and Mac OS

Purpose iCarousel is a class designed to simplify the implementation of various types of carousel (paged, scrolling views) on iPhone, iPad and Mac OS.

Nick Lockwood 11.9k Nov 19, 2021
A highly configurable and out-of-the-box-pretty UI library

FlourishUI [![CI Status](http://img.shields.io/travis/Clay McIlrath/FlourishUI.svg?style=flat)](https://travis-ci.org/Clay McIlrath/FlourishUI) We abs

Clayton (McIlrath) Unicorn 224 Mar 13, 2021
Declarative, configurable & highly reusable UI development as making Lego bricks.

LeeGo is a lightweight Swift framework that helps you decouple & modularise your UI component into small pieces of LEGO style's bricks, to make UI dev

WANG Shengjia 972 Oct 3, 2021
📖 A simple, highly informative page view controller

TL;DR UIPageViewController done properly. ⭐️ Features Simplified data source management & enhanced delegation. Dynamically insert & remove pages. Infi

UI At Six 1.6k Nov 26, 2021
A highly configurable and out-of-the-box-pretty UI library

FlourishUI [![CI Status](http://img.shields.io/travis/Clay McIlrath/FlourishUI.svg?style=flat)](https://travis-ci.org/Clay McIlrath/FlourishUI) We abs

Clayton (McIlrath) Unicorn 224 Mar 13, 2021
:bamboo: Spots is a cross-platform view controller framework for building component-based UIs

Spots is a cross-platform view controller framework for building component-based UIs. The internal architecture is built using generic view models tha

HyperRedink 15 Nov 8, 2021
An expandable/collapsible view component written in Swift.

AZExpandableIconListView An expandable/collapsible UIView that holds an array of UIImageView. Something like accordion. An interesting practice with a

Wu 287 Oct 22, 2021