Skip to content

Advanced open source iOS URL routing library with simple API - Prerelease

License

Notifications You must be signed in to change notification settings

aronbalog/ARoute

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ARoute

Build Status Version License Platform

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];



Author

Aron Balog

License

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

About

Advanced open source iOS URL routing library with simple API - Prerelease

Resources

License

Stars

Watchers

Forks

Packages

No packages published