TOSegmentedTabBarController
TOSegmentedTabBarController
is an open-source UIViewController
subclass to serve as a modal tab bar controller in instances where it's desirable to also include action buttons in the bottom bar.
This library is a component of TOFileKit
and as such, it was hastily built to suit just that library's needs. Feedback and PRs are welcome!
Features
- Swap between view controllers using a
UISegmentedControl
. - Optionally, can show two view controllers side by side on regular size devices.
- Properly responds to size class changes.
System Requirements
iOS 9.0 or above
Installation
As a CocoaPods Dependency
Add the following to your Podfile:
pod 'TOSegmentedTabBarController'
As a Carthage Dependency
Carthage support hasn't been implemented yet. Please open an issue if you want it.
Manual Installation
All of the necessary source and resource files for TOSegmentedTabBarController
are in the TOSegmentedTabBarController
folder. Simply copy this folder to your project, and import it into Xcode.
Examples
Using TOSegmentedTabBarController
is very straightforward. Simply create a new instance, and pass along the view controllers you want to display.
For a complete working example, check out the sample app included in this repo.
Basic Implementation
TOSegmentedTabBarController *segmentedController = [[TOSegmentedTabBarController alloc] initWithControllers:@[firstController, secondController]];
[self presentViewController:segmentedController animated:YES completion:nil];
Credits
TOSegmentedTabBarController
was originally created by Tim Oliver as a component for iComics, a comic reader app for iOS.
iOS Device mockups used in the screenshot created by Pixeden.
License
TOSegmentedTabBarController is licensed under the MIT License, please see the LICENSE file.