• Stars
    star
    297
  • Rank 140,075 (Top 3 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created almost 8 years ago
  • Updated about 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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.