gitmyhub

FoldingTabBar.iOS

Objective-C ★ 3.7k updated 4y ago

Folding Tab Bar and Tab Bar Controller

FoldingTabBar.iOS is an Objective-C library for iOS that replaces the standard app navigation bar at the bottom of the screen with an animated version that folds and unfolds. Instead of the usual row of icons that is always visible, the tab bar collapses down to a single center button (a "plus" icon). Tapping it triggers an animation where the other tab items expand outward to the left and right. Tapping the center button again collapses everything back.

Each tab item in the expanded bar can also have up to two extra small buttons placed to its left and right. These can be used to trigger actions related to the currently visible screen without navigating away from it, such as a search button or a compose button.

The library provides two main components. The first is a drop-in replacement for iOS's built-in tab bar controller called YALFoldingTabBarController, which handles the animation and the switching between screens automatically. The second is the tab bar view itself, which can be used independently if you want to write your own controller logic.

Setup in Xcode involves pointing the storyboard at the custom controller class, then supplying arrays of tab bar item images from your app delegate. A delegate protocol lets you respond to taps on the extra side buttons and observe when the bar is expanding or collapsing.

The library is available through CocoaPods and Carthage, the standard iOS dependency managers, and also supports manual installation by dropping the source files into a project. It works with both Objective-C and Swift. The minimum iOS version required is iOS 7.0. The design was inspired by an animation concept originally posted on Dribbble.