Latest 0.1.1
License MIT
Platforms ios 7.0, requires ARC

MCAppRouter License MIT

Badge w/ Version
Badge w/ Platform

URL routing for iOS made simple.


Add the following to your CocoaPods Podfile

pod 'MCAppRouter'

or clone as a git submodule,

or just copy files in the MCAppRouter folder into your project.

Setting up MCAppRouter

Add URL mappings as follows, preferrably in your App Delegate, specifying parameters prefixed with colon. The parameters are passed to each instance by setting the properties with key paths (See NSKeyValueCoding).

When instantiating from a UIViewController subclass:

[[MCAppRouter sharedInstance] mapRoute:@"color/:view.backgroundColor/" toViewControllerClass:[UIViewController class]];

When instantiating from a storyboard:

[[MCAppRouter sharedInstance] mapRoute:@"/user/:userID/display_name/:userName/" toViewControllerInStoryboardWithName:@"Main" withIdentifer:@"MCDemoViewController"];

Using MCAppRouter

Afterward, retrieve an instance of the required view controller like this:

UIViewController *controller = [[MCAppRouter sharedInstance] viewControllerMatchingRoute:@"/color/#2C99F8/"];

Or push it directly on a UINavigationController:

[self.navigationController pushViewControllerMatchingRoute:@"user/201/display_name/Michael" animated:YES];


Parameter values are always assumed to be NSString unless stated otherwise. Currently strings containing colors in hex format are converted to UIColor before being passed to instances. Other suggestions are welcomed.


MCAppRouter is under the MIT license.

Latest podspec

    "name": "MCAppRouter",
    "version": "0.1.1",
    "platforms": {
        "ios": "7.0"
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "summary": "URL routing for iOS made simple.",
    "homepage": "",
    "authors": {
        "Matthew Cheok": "[email protected]"
    "requires_arc": true,
    "source": {
        "git": "",
        "branch": "master",
        "tag": "0.1.1"
    "source_files": "MCAppRouter/*.{h,m}",
    "public_header_files": "MCAppRouter/*.h"

Pin It on Pinterest

Share This