Latest 0.1.1
License MIT
Platforms ios 6.0, requires ARC
Dependencies SDSegmentedControl
Frameworks QuartzCore

NGSegmentedViewController: A segmented view controller

Build Status

UIViewController subclass using SDSegmentedControl and View Controller Containment API’s to switch between child view controllers


(click to download a video of the controller in action).


  • Uses View Controller Containment API’s to display a list of view controllers
  • Uses the excellent SDSegmentedControl to display a view controller switcher at the top
  • Can be used with code and Interface Builder
  • Can be used with Autolayout
  • When using UITableView‘s or UICollectionView‘s automatically adjusts contentInset and scrollIndicatorInsets to accomodate for segmented control
  • Allows for a delegate to be notified when the selected view controller will / did change


  • ARC
  • Xcode 4.4+ (needed for modern Objective-C syntax)
  • iOS 6+


From CocoaPods

Add pod 'NGSegmentedViewController' to your Podfile.


Important note if your project doesn’t use ARC: you must add the -fobjc-arc compiler flag to NGSegmentedViewController.m in Target Settings > Build Phases > Compile Sources.

  • Drag the NGSegmentedViewController/NGSegmentedViewController folder into your project
  • Download SDSegmentedControl and drag SDSegmentedControl.{h,m} into your project
  • Add the QuartzCore framework to your project
  • You might need to change the #import <SDSegmentedControl/SDSegmentedControl.h> in NGSegmentedViewController.h to #import "SDSegmentedControl.h"


I have added two demos. NGSegmentedViewController example uses code to set up a segmented view controller and NGSegmentedViewController IB example uses Interface Builder to set one up.


As this is my first open source iOS control, it is possible that I made mistakes. Furthermore, I only implemented features that seemed useful to me. If you find any errors or want extra features, feel free to fork this project and sent in a Pull Request.


Instantiate a segmented view controller with initWithViewControllers: or initWithViewControllers:titles:.

When using Interface Builder, create a subclass and overwrite awakeFromNib to call setupWithViewControllers: or setupWithViewControllers:titles:.

License and copyright

All source code is licensed under the MIT-License.

Copyright 2013 Nicky Gerritsen.


Latest podspec

    "name": "NGSegmentedViewController",
    "version": "0.1.1",
    "summary": "UIViewController subclass using SDSegmentedControl and View Controller Containment API's to switch between child view controllers.",
    "homepage": "",
    "screenshots": "",
    "license": "MIT",
    "authors": {
        "Nicky Gerritsen": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.1.1"
    "platforms": {
        "ios": "6.0"
    "source_files": "NGSegmentedViewController",
    "frameworks": "QuartzCore",
    "requires_arc": true,
    "dependencies": {
        "SDSegmentedControl": [
            "~> 1.0"

Pin It on Pinterest

Share This