DTRouter 1.0.2

DTRouter 1.0.2

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Apr 2017

Maintained by Nicolas Kim.



DTRouter 1.0.2

  • By
  • DreamTracer

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

[email protected]

License

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