- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height)];
// 初始化路由器
[[YJRouterManager sharedInstance] registerMainScheme:nil keyWindow:self.window];
// 其他设置...
[self.window makeKeyAndVisible];
return YES;
}
+ (void)load{
[YJRouterManager registerRouterCode:@"R1101" customInitBlock:nil];
}
/**
push 方式打开
@param url 路由url 比如: "yj://1101?id=2001"
@param parameter 参数字典
@param navigationController 导航控制器 如果是nil, 默认当前导航 并不是present的导航
@param complete 初始化完成的回调
*/
+ (void)pushViewControllerUrl:(NSString *)url parameter:(NSDictionary *)parameter navigationController:(UINavigationController *)navigationController complete:(YJViewControllerCreatedBlock)complete;
/**
present 方式打开
@param url 路由url 比如: "yj://1101?id=2001"
@param parameter 参数字典
@param showType 显示类型 带导航还是不带
@param sourceViewController 起始控制器 如果是nil 默认是window根控制器
@param packingNavigationBlock 包装导航方法
@param complete 初始化完成的回调
*/
+ (void)presentViewControllerUrl:(NSString *)url parameter:(NSDictionary *)parameter showType:(YJRouterShowType)showType sourceViewController:(UIViewController *)sourceViewController packingNavigationBlock:(YJPackingNavigationBlock)packingNavigationBlock complete:(YJViewControllerCreatedBlock)complete
This code is distributed under the terms and conditions of the MIT license.