Home

Awesome

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 of customizing the UITabBar. For instance: change font style, add animation, and use bigger items. However it's hard to do with UITabBarItem.

With ESTabBarController, You can easily achieve these!

-FeatureDescription
1Default styleYou can get a system-like style by initializing the TabBar with ESTabBarController directly. </p> UITabBarController style: </p> System native style </p> ESTabBarController default style: </p> ES system-like style
2Default style with "More" itemIf the items are more than the maximum number of displays, there will be a "More" item. </p> UITabBarController with "More": </p> enter image description here </p> ESTabBarController with "More": </p> enter image description here
3Mix UITabBarItem and ESTabBarItemYou can set any item as you want, including UITabBarItem and ESTabBarItem. </p> ESTabBar and UITabBar mixed style: </p> enter image description here </p> ESTabBar and UITabBar mixed style with "More": </p> enter image description here
4UIKit attributesESTabBarController is compatible with UITabBarController, UITabBar and UITabBarItem's most API attributes. You can migrate to ESTabBarController without any modification of the origin code. </p> Compatible with UITabBarController's selectedIndex: </p> enter image description here
5Any nesting with UINavigationControllerDeveloping withUITabBarController, there are two common ways to handle layers: </p> First : </p> ├── UITabBarController </p> └──── UINavigationController </p> └────── UIViewController </p> └──────── SubviewControllers </p> Second : </p> ├── UINavigationController </p> └──── UITabBarController </p> └────── UIViewController </p> └──────── SubviewControllers </p> In the first case, need to set hidesBottomBarWhenPushed = true when pushing subViews. The second is not. </p> In ESTabBarController, add Container views to UITabBar to be compatible with these two ways。
6Customizable styleWith ESTabBarController, you can:</p> 1. Customize selected item's color and style: </p> enter image description here </p> 2. Add selecting animation: </p> enter image description here </p> 3. Customize item's background color: </p> enter image description here </p> 4. Add highlight animation: </p> enter image description here </p> 5. Add animation to prompt users: </p> enter image description here </p> 6. And much more ... </p>
7Customizable item's size </p> Customizable click eventYou can easily customize item's size using ESTabBarController. </p> When the button's frame is larger than TabBar, HitTest makes the outer TabBar area click valid. </p> In addition, ESTabBarController can customize click event, and through a block to callback super-layer to handle. </p> With big item in the middle of TabBar: </p> enter image description here </p> With a special hint style: </p> enter image description here </p> Customize click event: </p> enter image description here
8Default notification styleYou can get a system-like notification style by initializing the TabBar with ESTabBarController directly. </p> UITabBarController notification style: </p> enter image description here </p> ESTabBarController system-like notification style: </p> enter image description here
9Customizable notification styleWith ESTabBarController, you can:</p> 1. Customize notification animation: </p> enter image description here </p> enter image description here </p> 2. Customize prompt style: </p> enter image description here </p> 3. And much more ... </p>
10LottieThrough customizing ContentView, you are able to add Lottie's LAAnimationView to Item(s) </p> enter image description here

Requirements

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

Swift Package Manager

...
dependencies: [
    .package(name: "ESTabBarController", url: "https://github.com/eggswift/ESTabBarController.git", from: "2.9.0-spm")
]
...

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 edited, problems occur.
  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:

<a href='https://tracking.gitads.io/?repo=ESTabBarController'><img src="https://images.gitads.io/ESTabBarController" alt="git-ad"/></a> <br><i>This advert was placed by <a href="https://tracking.gitads.io/?campaign=gitads&repo=ESTabBarController&redirect=gitads.io">GitAds</a> </i>

Acknowledgement

About

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

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.