Skip to content

Latest commit

 

History

History
57 lines (42 loc) · 2.15 KB

README.md

File metadata and controls

57 lines (42 loc) · 2.15 KB

WLRRoute

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

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

pod "WLRRoute"

Architecture

RouteClassMap

中文介绍

WLRRoute是一个简单的iOS路由组件 详情请移步文章介绍: 移动端路由层设计 一步步构建iOS路由 本代码会随着大家的讨论逐步更新,喜欢的来个星✨~谢谢 ##Usage

self.router = [[WLRRouter alloc]init];
[self.router registerHandler:[[WLRSignHandler alloc]init] forRoute:@"/signin/:phone([0-9]+)"];
[self.router handleURL:[NSURL URLWithString:@"WLRDemo://com.wlrroute.demo/signin/13812345432"] primitiveParameters:nil targetCallBack:^(NSError *error, id responseObject) {
        NSLog(@"SiginCallBack");
    } withCompletionBlock:^(BOOL handled, NSError *error) {
        NSLog(@"SiginHandleCompletion");
    }];

[self.router registerHandler:[[WLRUserHandler alloc]init] forRoute:@"/user"];
[self.router handleURL:[NSURL URLWithString:@"WLRDemo://com.wlrroute.demo/user"] primitiveParameters:@{@"user":@"Neo~🙃🙃"} targetCallBack:^(NSError *error, id responseObject) {
        NSLog(@"UserCallBack");
    } withCompletionBlock:^(BOOL handled, NSError *error) {
        NSLog(@"UserHandleCompletion");
    }];

Author

Neo, [email protected]

License

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