Latest 0.1.0
Homepage https://github.com/carlSQ/NHRouter
License MIT
Platforms ios 7.0
Authors

CI Status

Introduce

router controller by url, parmas can pass by url that object can be pass by pointer or pass by dictionary

Usage

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

pod "NHRouter"

Register Controller Class

#import <NHRouter/NHRouter.h>

@implementation 

RouterRegister(@"Scheme",@"router")

@end

or

+ (void) load {
  [NHRouter registerRouter:router toScheme:scheme forControllerClass:[self class]];
}

Map Controller Instance


UIViewController *controller =[NHRouter mapControllerForUrl:@"Scheme://router?key=test"];

Pass Parmas

pass by url (object pass pointer) or dictionary

Router

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

[NHRouter sharedRouter].globalContext = (NHRouterContext *)self.window.rootViewController;

return YES;
}

  [NHRouter open:[NSString stringWithFormat:@"Scheme://router?%@=%@",BOXKey(@"key"),BOXObject(self)] animated:YES];

Router Back


 [self routerBack:YES completion:^{
      // do some thing
 }];

Author

carl shen

License

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

Latest podspec

{
    "name": "NHRouter",
    "version": "0.1.0",
    "summary": "NHRouter is framework that can router controller by url for Decoupling",
    "description": "NHRouter is framework that can router controller by url, parmas can pass by url that object can be pass by pointer or pass by dictionary",
    "homepage": "https://github.com/carlSQ/NHRouter",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "qiang.shen": "[email protected]"
    },
    "source": {
        "git": "https://github.com/carlSQ/NHRouter.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source_files": "NHRouter/Classes/**/*"
}

Pin It on Pinterest

Share This