SNFSegmentedViewController is the simplest way to use a UISegmentedControl
to switch between view controllers. You don't have to worry about view controller containment or setting up a kludge of custom empty segues. SNFSegmentedViewController just works.
Since SNFSegmentedViewController
is a subclass of UITabBarController
, all you have to do is:
- Drag out a
UITabBarController
into a storyboard, and embed it in aUINavigationController
. - Wire it up to your views appropriately.
- Change its class to
SNFSegmentedViewController
.
It's that simple.
Add SNFSegmentedViewController
to your Podfile if you're using CocoaPods, or add SNFSegmentedViewController.{h,m}
into your project.
SNFSegmentedViewController requires iOS 6.0 and above, and it requires ARC.
SNFSegmentedViewController was created by Seth Friedman.
Special thanks to Bill Shirley for demonstrating how to hide the UITabBar
.
SNFSegmentedViewController is available under the MIT license.
If you're using SNFSegmentedViewController in your project, I'd love to hear about it! Be sure to add it to the list.