Latest 0.0.1
Homepage https://github.com/YJManager/YJRouterManagerOC
License MIT
Platforms ios 8.0, requires ARC
Authors

YJRouterManagerDemo

Travis
Language
GitHub tag

效果

使用方法

在 AppDelegate 初始化注册

- (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;
}

在 YJRouterManagerConfig.plist 配置映射关系 或者 在控制器中手动注册

Plist 方式

控制器注册方式

+ (void)load{
    [YJRouterManager registerRouterCode:@"R1101" customInitBlock:nil];
}

Push 方式

/**
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 方式

/**
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

License

This code is distributed under the terms and conditions of the MIT license.

Latest podspec

{
    "name": "YJRouterManagerOC",
    "version": "0.0.1",
    "summary": "YJRouterManagerOC iOS u8defu7531u5668, Author's email:[email protected] u5de5u4f5cu5730u70b9:BeiJing",
    "description": "YJRouterManagerOC iOS u8defu7531u5668, Author's email:[email protected] u5de5u4f5cu5730u70b9:BeiJing. u6b22u8fceu4e00u8d77u4ea4u6d41.",
    "homepage": "https://github.com/YJManager/YJRouterManagerOC",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "houmanager": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/YJManager/YJRouterManagerOC.git",
        "tag": "0.0.1"
    },
    "source_files": "YJRouterManager/*.{h,m}",
    "requires_arc": true
}

Pin It on Pinterest

Share This