SabBar

Drop-in UITabBarController subclass that shows a sidebar with tabs based on trait collections.


License
MIT
Install
pod try SabBar

Documentation

SabBar

Drop-in UITabBarController subclass that shows a sidebar with tabs based on trait collections.

License MIT Version Carthage compatible travis-ci codecov.io Swift 2 iOS 8+

split-view

Description

SabBar aims to let you easily choose to show a sidebar with the same functionality of a UITabBar inside of your application, based on trait collections. To do so we've created a UITabBarController subclass called SabBarController that does most of the work. We've also added few options to customize the appearance of those sidebar (width, tab height, top navigation bar, header view, ecc).

iPhone-landscape

Features

  • Ready to use, just swap a class.
  • iPad and iPhone compatible.
  • Single drop-in file.
  • Customize sidebar appearance based on trait collections.
  • No dependancies.
  • Tests.
  • Supports accessibility.
  • Optional header view.
  • Work well with and without navigation bars.
  • Automatically grabs customizations from the UITabBar.
  • Full documentation.
  • Support top, bottom and centered sidebar cells.
  • Support sidebar translucency.

Requirements

  • iOS 8.0+
  • Xcode 7.1+

Documentation

Online documentation is available curtesy of CocoaDocs. You can also navigate it offline downloading the source code and looking inside the docs folder.

Usage

Import SabBar module into your Swift class

import SabBar

or if you are writing in Objective-C

#import <SabBar/SabBar-Swift.h>

Keep in mind the you have to let the project generate the Bridging Header otherwise the integration may fail.

Just replace any UITabBarController instance with a SabBarController one directly on Storyboards or programmatically.

custom-class

🎉

Sample project

In the Sample folder you can find a sample project with few lines of code in the AppDelegate class for a jumpstart.

Unfortunately you cannot create a subclass written on Objective-C of a Swift class, so you can use SabBar in an Objective-C project, but if you need to subclass the SubBarController you are forced to do it in Swift.

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

CocoaPods 0.39.0+ is required to build Marklight.

To integrate SabBar into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
target "YourTargetName" do
    pod 'SabBar'
end

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate Marklight into your Xcode project using Carthage, specify it in your Cartfile:

github "macteo/SabBar"

Run carthage update --platform iOS to build the framework and drag the built SabBar.framework into your Xcode project.

Manually as a Framework

Add the SabBar Xcode project to your own. Then add the SabBar framework to the embedded binaries of your app's target.

Manually as source file

Just drag & drop the SabBar.swift source file from the Sources folder in your Xcode project.

Issues and bugs

Feel free to open an issue reporting a problem or requesting a new feature.

Acknowledgements

License

SabBar is released under the MIT license. See LICENSE for details.