A simple Controller Router.Inspired by HHRouter.
Register route patterns to viewController. Better in AppDelegate.
[[DJRouter shared] registerRouter:Router_Second toControllerClass:[SecondViewController class]];Get viewController instance from route.
UIViewController *controller = [[DJRouter shared] matchController:Router_Second];
or Storyboard、xib:
UIViewController *controller = [[DJRouter shared] matchControllerWithStoryboardName:kMainStoryboard route:Router_Second];Pass parameter is also supported, which will make things VERY flexible.
UIViewController *controller = [[DJRouter shared] matchController:Router_Second params:@{@"a":@"a",@"b":@"b"}];Support controller reverse parameter callback.
[DJRouter shared].callback = ^(NSString * _Nonnull route, id _Nullable params) {
NSLog(@"route:%@, params:%@", route, params);
};pod 'DJRouter', '~> 0.0.1'DJRouter is available under the MIT license.