测试已测试 | ✗ |
语言语言 | Objective-CObjective C |
许可证 | MIT |
发布最后发布 | 2016年4月 |
由liujianping维护。
要运行示例项目,请克隆仓库,并首先从Example目录运行pod install
URLTabNavigationController可以通过CocoaPods安装。要安装它,只需将以下行添加到您的Podfile中
pod "URLTabNavigationController"
#import "URLTabNavigationController.h"
//! singleton instance
URLTabNavigationController* tabNavigation = [URLTabNavigationController defaultTabNavigationController];
//! tab navigate url to class name
[tabNavigation navigate:@"/red" title:@"red" image:nil selectedImage:nil className:@"RedViewController"];
[tabNavigation navigate:@"/blue" title:@"blue" image:nil selectedImage:nil className:@"BlueViewController"];
[tabNavigation navigate:@"/yellow" title:@"yellow" image:nil selectedImage:nil className:@"YellowViewController"];
//! tab bar controller initialization
[tabNavigation initialization];
#import "URLRouter.h"
//! singleton instance
URLRouter* router = [URLRouter defaultRouter];
//! router map path to class name
[router map:@"/home/:user" withControllerClassName: @"HomeViewController"];
[router map:@"/message" withControllerClassName: @"MessageViewController"];
[router map:@"/mine" withControllerClassName:@"MineViewController"];
//! router map path pattern example
[router map:@"/:name/:age/:hobby" withCompletion: ^(NSURL* url){
NSLog(@"block exeucte (name: %@) (age: %@) (hobby: %@)", url.queryDictionary[@"name"], url.queryDictionary[@"age"], url.queryDictionary[@"hobby"]);
}];
//! router map path pattern for View Controller
UIViewController* vc = [router viewControllerForPath:@"/home/liujianping"];
//! router map path pattern for excute URL
[router executeURL:[[NSURL alloc] initWithString: @"/liujianping/36/movie"]];
liujianping, [email protected]
URLTabNavigationController在MIT许可证下可用。有关更多信息,请参阅LICENSE文件。