Showing posts with label Segment. Show all posts
Showing posts with label Segment. Show all posts

Wednesday, February 19, 2014

FH Segmented View Controller

FHSegmentedViewController

123

Requirements

  • iOS 6.1+
  • ARC

Installation

From CocoaPods

pod 'FHSegmentedViewController'

From source

  • Drag the FHSegmentedViewController folder to your project

Getting Started

  1. Create a subclass of FHSegmentedViewController in your project
#import "FHSegmentedViewController.h"

@interface MasterViewController : FHSegmentedViewController
2.Implement - (void)viewDidLoad
- (void)viewDidLoad
{
    [super viewDidLoad];

    [self setViewControllers:@[[self.storyboard instantiateViewControllerWithIdentifier:@"firstSubViewController"], [self.storyboard instantiateViewControllerWithIdentifier:@"secondSubViewController"]]];
}
  1. Push an instance of AnotherViewController.
    UIViewController *viewController = [self.storyboard instantiateViewControllerWithIdentifier:@"firstSubViewController"];
    [self pushViewController:viewController title:@"anotherViewController"]; 
Download: https://github.com/iDay/FHSegmentedViewController/archive/master.zip