Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

NicolasKim/DTRouter

Open more actions menu

Repository files navigation

DTRouter

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

DTRouter is available through CocoaPods. To install

it, simply add the following line to your Podfile:

pod "DTRouter"
or  'DTRouter/Core'
or  'DTRouter/UI'

Usage

//regist 
-(void)addRouter:(NSString *)URLPattern handler:(DTRouterRegistHandler)handler;

//route
-(DTRouterResponse *)route:(NSString *)URLString arguments:(NSDictionary *)arguments;

-(NSOperation *)asyncRoute:(NSString *)URLString arguments:(NSDictionary *)arguments handler:(DTResponseBlock)handler;
//regist
[[DTRouterService sharedInstance]addRouter:@"addnumber/:num" handler:^id(NSDictionary *paths, NSDictionary *arguments) {
		NSString * num = paths[@"num"];
		handler    handle = arguments[@"taskkey"];
        return nil;
}];

//route
handler  h = ^(long long num){
                NSLog(@"current num : %lld",num);
             };
[[DTRouterService sharedInstance]asyncRoute:@"addnumber/100" arguments:@{@"taskkey":h} handler:^(DTRouterResponse *response) {
	NSLog(@"result : %@",response.resultValue);
}];

Author

jinqiucheng1006@live.cn

License

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.