ARoute 0.0.15

ARoute 0.0.15

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

Maintained by Aron Balog.



ARoute 0.0.15

  • By
  • Aron Balog

Table of contents

  1. Demo
  2. Requirements
  3. Installation
  4. Swift
    1. Example
    2. Documentation
  5. Objective-C
    1. Example
    2. Documentation



Demo

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

Requirements

  • iOS 7.0 or greater

Installation

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

pod "ARoute"

Swift

Swift example

Work in progress.

Objective-C

Objective-C example

Full route registration example:

NSDictionary *routes = @{
    @"user/{userId=number}": [UserViewController class]
};

[[[[[[ARoute sharedRouter]
    registerRoutes:routes] separator:^NSString *{
    return @"{}";
}] parameters:^NSDictionary*{
    return @{@"Key3":@"Value3"};
}] castingSeparator:^NSString*{
    return @"=";
}] execute];

Full route execution example:

[[[[[[[[[[ARoute sharedRouter] route:@"user/12345"] embedInNavigationController] protect:^BOOL(ARouteResponse * _Nonnull routeResponse, NSError * _Nullable __autoreleasing * _Nullable errorPtr) {
    // return YES if you don't want to handle the route
    return NO;
}] parameters:^NSDictionary*{
    return @{
             @"Key1": @"Value1",
             @"Key2": @"Value2"
             };
}] transitioningDelegate:^id<UIViewControllerTransitioningDelegate>{
    // return object conforming <UIViewControllerTransitioningDelegate>
    return nil;
}] animated:^BOOL{
    return YES;
}] completion:^(ARouteResponse *routeResponse) {
    // handle the completion
}] failure:^(ARouteResponse * _Nonnull routeResponse, NSError * _Nullable error) {
    // handle the error
}] execute];

Objective-C documentation



Author

Aron Balog

License

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