Skip to content

this is a tool to help you to handle the push or pop between Viewcontrollers with your specified URL

License

Notifications You must be signed in to change notification settings

xindizhiyin2014/JKRouter

Repository files navigation

JKRouter

CI Status Version License Platform

Example

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

Requirements

Installation

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

pod "JKRouter"

Author

HHL110120, [email protected]

QQ Contact group

if you use QQ you can use this Qrcode to contact with us

License

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

guide

you can use the pod with the steps

config JKRouter

 [JKRouter configWithRouterFiles:@[@"modules.json",@"modules123.json"]];

configRootViewController

do not use TabBarViewController

JKViewController *vc = [JKViewController new];
self.window.rootViewController = vc;

if you use TabBarViewController

step1

self.rootTabBarController = [[RootTabbarViewController alloc] init];

UINavigationController *naVC = [[UINavigationController alloc] initWithRootViewController: self.rootTabBarController];
self.window.rootViewController = naVC;

step2 override the viewWillAppear of tabBarViewController

- (void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:YES animated:animated];

}

use viewController className to open the specified ViewController

 [JKRouter open:@"JKAViewController"];

use the scheme defined by yourself such as "jkpp"

step1

in JKRouterExtension+Jack.m file

+ (NSArray *)urlSchemes{

return @[@"http",@"https",@"jkpp"];
}

step2

 [JKRouter URLOpen:@"jkpp://jackApp:10001"];
 [JKRouter URLOpen:@"jkpp://jackApp:10002?testContent=Hi, I'm Jack"];
 [JKRouter URLOpen:@"jkpp://jackApp:10004/abc/mn/qq"];

use special transform animation

step1

in the target ViewController

- (RouterTransformVCStyle)jkRouterTransformStyle{
return RouterTransformVCStyleOther;
}

step2

config the animation in the function

- (void)jkRouterSpecialTransformWithNaVC:(UINavigationController *)naVC{
UIViewController *vc = naVC.topViewController;
vc.navigationController.delegate = self;

[naVC pushViewController:self animated:YES];
}

use access judge

if your app pages have access judgement please follow the next step in the target viewController

+ (BOOL)validateTheAccessToOpen{
//with the judment code
return YES;
}

+ (void)handleNoAccessToOpen{

//do the action if has no access
}

实现历程博客

《iOS路由跳转(一)之初识URL》

《iOS路由跳转(二)之需求分析》

《iOS路由跳转(三)之JKRouter基础教程1》

《iOS路由跳转(三)之JKRouter基础教程2》

《iOS路由跳转(四)之JKRouter持续更新1》

《iOS路由跳转(五)之JKRouter 2.0 脱胎换骨》

《JKRouter路由跳转解决了哪些问题》

《JKRouter路由跳转中文使用手册》

《JKRouter更新之present带导航栏的控制器》

《JKRouter完美实现微信小程序的跳转》

《JKRouter实现通过url切换web容器》

《JKRouter路由跳转 实现对工厂方法的支持》

《JKRouter路由跳转 实现对工厂方法的支持》

《JKRouter路由跳转实现对swift的支持》

《JKRouter增加黑白名单制度啦》

About

this is a tool to help you to handle the push or pop between Viewcontrollers with your specified URL

Resources

License

Stars

Watchers

Forks

Packages

No packages published