PSRouter 0.0.7

PSRouter 0.0.7

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布最新发布2017年12月

sheep 维护。



PSRouter 0.0.7

  • 作者:
  • 杨志强

PSRouter

PSRouter 是实现控制器之间滑动过渡的好方法,适合 MVVM。您不需要导入控制器头文件,只需在 AppDelegate 中注册即可。

Podfile

target 'TargetName' do
pod 'PSRouter'
end

在 didFinishLaunchingWithOptions 中注册控制器

[[PSRouter shareInstance] registerClass:[ViewController class] protocol:@protocol(protocol)];

参数

您应该使用协议来传递参数

@protocol protocol<NSObject>
@property (nonatomic, strong) id para;
、、、
@end

注册的控制器应遵循在 PSRouter 中注册的协议

@interface ViewController ()<protocol>
@end
@implementation ViewController
@synthesize para = _para;
@end

推送或显示控制器

将 YES 传递给 isModel 以指定显示样式

[[PSRouter shareInstance] openScheme:<#(nonnull Protocol *)#> property:<#^(id  _Nullable x)property#> isModel:<#(BOOL)#>]

默认为推送样式

[[PSRouter shareInstance] openScheme:@protocol(protocol) property:^(id<protocol>target) {
        target.buttonTitle = @"Sectond";
    }];