Latest 0.1.1
License MIT
Platforms ios 7.0, requires ARC

[![CI Status]( Fu/SMBCustomRelationshipSegue.svg?style=flat)]( Fu/SMBCustomRelationshipSegue)


To run the example project, clone the repo, and run pod install from the Example directory first.

I’ve managed to make the custom container view controller set up relationship with its child view controllers looks as Apple’s UINavigtaionController or UITabbarController do in storyboard.

there are two examples in example folder:

  • sidemenu

    this example uses RESideMenu as a custom container view controller to show how to use SMBCustomRelationshipSegue make your storyboard continuous and meaningful

    RESideMenu is a very beautiful custom container view controller and here is the link

  • container

    this example is inspired by’s Custom Container View Controller Transitions and the repo is here. In that repo, the project implement the custom container view controller without any interface file, and I update it with SMBCustomRelationshipSegue, now the relationship between container view controller and child view controllers can be seen in storyboard

SMBCustomRelationshipSegue now supports one to one relationship(like UINavigationController’s rootViewController relationship segue) and one to many relationship (like UITabbarController’s viewControllers relationship segue). all you need to do are just two steps:

  1. subclass your view controller or UIViewController, overwrite the method:

    - (NSArray *)relationships

return the array of your property names which you want build a relationship, the lib will check it for you whether it is a one to one or one to many.

Note: if you overwrite the method awakeFromNib, you must call awakeFromNib super implementation or the SMBCustomRelationShipSegue would not work.
RESideMenu‘s implementation overwrite the awakeFromNib and did not call the super implementation, I commit pull request, however I got no reply

  1. you need control drag your storyboard. link a custom relation ship segue between container view controller and child view controllers. and name the segue identifier .

    • one to one relationship should name with format

    • one to many relationship should name with format


Note: you should ensure the index is continuous and started with 0

then it’s OK! followings are screenshot building relationships:



iOS 7.0 and iOS 7.0 +


SMBCustomRelationshipSegue is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "SMBCustomRelationshipSegue"


David Fu, [email protected]


SMBCustomRelationshipSegue is available under the MIT license. See the LICENSE file for more info.

Latest podspec

    "name": "SMBCustomRelationshipSegue",
    "version": "0.1.1",
    "summary": "a simple implementation for custom relationship segue",
    "description": "SMBCustomRelationshipSegue is a simple implementation for custom relationship segue, enhance the custom container view controller in storyboard like UINavigationController or UITabbarController. if you are developer who like storyboard and want use it to show your view contorller logic on storyboard to make life easy, SMBCustomRelationshipSegue should be in your toolbox",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "David Fu": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.1.1"
    "platforms": {
        "ios": "7.0"
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "SMBCustomRelationshipSegue": [

Pin It on Pinterest

Share This