From e17e80fa322a637816a7bc9b3cdd4ce0d08eba04 Mon Sep 17 00:00:00 2001 From: Light Date: Tue, 18 Mar 2014 12:02:07 +0800 Subject: [PATCH] Update README/Who Use HHRouter. --- README.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2978d74..f1f9ace 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,11 @@ Define a `NSDictionary` property named `params` in viewControllers. Better in yo ### Exciting Time Get viewController Instance from URL. Params will be automatic parsed. -```objective +```objective-c UIViewController *viewController = [HHRouter shared] match:@"/user/1/"]; +``` + +```objective-c XCTAssertEqualObjects([viewController class], [UserViewController class]); XCTAssertEqualObjects(viewController.params[@"route"], @"/user/1/"); XCTAssertEqualObjects(viewController.params[@"userId"], @"1"); @@ -35,6 +38,9 @@ URL Query Params is also supported. This will make things VERY flexable. ```objective-c UIViewController *viewController = [HHRouter shared] match:@"/user/1/?tabIndex=3"]; +``` + +```objective-c XCTAssertEqualObjects(viewController.params[@"tabIndex"], @"3"); ``` @@ -43,7 +49,11 @@ XCTAssertEqualObjects(viewController.params[@"tabIndex"], @"3"); If your app has defined some url schemes, HHRouter will know. ```objective-c -XCTAssertEqualObjects([[[HHRouter shared] match:@"hhrouter://user/1/"] class], [UserViewController class]); +UIViewController *viewController = [[HHRouter shared] match:@"hhrouter://user/1/"]; +``` + +```objective-c +XCTAssertEqualObjects([viewController class], [UserViewController class]); ``` ## Installation @@ -63,5 +73,10 @@ If you're not able to use CocoaPods, please install HHRouter as a [git submodule - [lightory@gmail.com](mailto:lightory@gmail.com) - [http://twitter.com/lightory/](http://twitter.com/lightory/) +## Who use HHRouter? +If you're building your applications using HHRouter, please let me know! (add your application name & App Store link here and pull reuqest this README. + +- 火花: [https://itunes.apple.com/cn/app/huo-hua-dian-shi-ju/id584296227?mt=8](https://itunes.apple.com/cn/app/huo-hua-dian-shi-ju/id584296227?mt=8) + ## License HHRouter is available under the [MIT license](https://github.com/Huohua/HHRouter/blob/master/LICENSE). \ No newline at end of file