Skip to content

theNightLight/ESTabBarController

Repository files navigation

ESTabBarController

Swift v5 GitHub

Note: This is a community fork of eggswift/ESTabBarController with iOS 26 Liquid Glass support. CocoaPods / Swift Package Manager are not provided here to avoid conflicting with the upstream release. Please integrate by downloading the source code.

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

This fork adds iOS 26 layout properties on ESTabBar. Defaults work out of the box:

  • designType (default .automatic): .automatic adapts layout by OS version; .old always uses legacy TabBar layout (hides platter and distributes tabs evenly on iOS 26+)
  • usesSystemGlassEffect (default true): effective only when designType == .automatic on iOS 26+; true enables system Liquid Glass dual-layer embedding, false hides system buttons and uses full-width ESTabBarItemContainer layout

Default behavior: with no configuration, iOS 26 shows the system glass TabBar; below iOS 26 matches upstream legacy layout.

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!

- Feature Description
1 Default style You can get a 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, HitTest makes the 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 a 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
11 iOS 26 Liquid Glass iOS 26 introduces Liquid Glass on the system TabBar. ESTabBarController adapts via designType and usesSystemGlassEffect (iOS 26+):

1. System glass (default): designType = .automatic, usesSystemGlassEffect = true. Custom items embed into the system _UITabBarPlatterView dual-layer structure, preserving system glass compositing and selection animation.

System glass mode

2. Custom container: designType = .automatic, usesSystemGlassEffect = false. Hides system buttons and lays out ESTabBarItemContainer across the full width for fully custom appearance.

No system glass mode

3. Mandatory old design: designType = .old. Always uses legacy layout; on iOS 26+ hides the platter and distributes tabs evenly, matching pre-iOS 26 behavior.

Mandatory old design

4. System glass + Badge: Badges show on unselected items in glass mode; the selected item hides its badge automatically.

System glass with badge

Requirements

  • Xcode 8 or later
  • iOS 8.0 or later (Liquid Glass requires iOS 26.0+)
  • 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. The Basic section includes the iOS 26 layout modes above.

iOS 26 Liquid Glass

let tabBarController = ESTabBarController()
if let tabBar = tabBarController.tabBar as? ESTabBar {
    // .automatic (default, adapts by OS) or .old (force legacy layout)
    tabBar.designType = .automatic

    // Only when designType == .automatic on iOS 26+
    // true: system glass dual-layer embed (default); false: custom container full-width layout
    tabBar.usesSystemGlassEffect = true
}
Property Default Description
designType .automatic .old ignores usesSystemGlassEffect and always uses legacy layout
usesSystemGlassEffect true Effective only with .automatic on iOS 26+

Usage

This fork supports source download / manual integration only. CocoaPods and Swift Package Manager are intentionally not published.

Download

git clone https://github.com/theNightLight/ESTabBarController.git
cd ESTabBarController
open ESTabBarControllerExample/ESTabBarControllerExample.xcodeproj

Integrate into your project

  1. Drag all Swift files from ESTabBarControllerExample/ESTabBarControllerExample/Sources/ into your Xcode target.
  2. Use ESTabBarController as your root controller — see the Example project for reference.

For official CocoaPods / SPM from upstream, use eggswift/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

If this project helps you, consider buying me a coffee:

Alipay WeChat
Alipay WeChat

Acknowledgement

About

Maintained by haochen. Questions and contributions welcome via Issues and Pull Requests.

Changelog

See CHANGELOG.md.

License

The MIT License (MIT)

Copyright (c) 2013-2016 eggswift
Copyright (c) 2026 haochen

See LICENSE for the full text.

Original Author

This project is modified based on eggswift/ESTabBarController. Original author: eggswift

About

本项目为 [eggswift/ESTabBarController](https://github.com/eggswift/ESTabBarController) 的个人维护分支,主要新增 iOS 26 Liquid Glass 适配。**不提供 CocoaPods / Swift Package Manager 集成**,以免影响上游官方发布;请通过下载源码手动集成。

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages