URLTabNavigationController 0.1.1

URLTabNavigationController 0.1.1

测试已测试
语言语言 Objective-CObjective C
许可证 MIT
发布最后发布2016年4月

liujianping维护。



  • 作者
  • liujianping

用法

要运行示例项目,请克隆仓库,并首先从Example目录运行pod install

需求

安装

URLTabNavigationController可以通过CocoaPods安装。要安装它,只需将以下行添加到您的Podfile中

pod "URLTabNavigationController"

快速开始

TabBar导航

#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];

URL路由器

#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文件。