ARoute 0.0.15

ARoute 0.0.15

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布时间最后发布时间2017年1月

Aron Balog维护。



ARoute 0.0.15

  • Aron Balog

目录

  1. 演示
  2. 要求
  3. 安装
  4. Swift
    1. 示例
    2. 文档
  5. Objective-C
    1. 示例
    2. 文档



演示

要运行示例项目,请克隆仓库,并首先在Example目录中运行pod install

要求

  • iOS 7.0或更高版本

安装

ARoute可以通过CocoaPods获取。要安装它,只需将以下行添加到您的Podfile中

pod "ARoute"

Swift

Swift示例

进行中。

Objective-C

Objective-C示例

完整路由注册示例

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

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

完整路由执行示例

[[[[[[[[[[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文档



作者

Aron Balog

许可证

ARoute可在MIT许可下使用。有关更多信息,请参阅LICENSE文件。