测试已测试 | ✗ |
Lang语言 | Obj-CObjective C |
许可协议 | MIT |
发布上次发布 | 2016年10月 |
由Andrey Zarembo、Egor Tolstoy维护。
RamblerSegues 是一系列定制的 UIStoryboardSegue 子类,适用于各种日常情况。
UIViewController
。UIStoryboard
,那么这个转换就是您完美的选择。UIViewController
上添加一个 UIView
- 这个视图将适合作为子模块的容器。将其链接到具有名称 embedSegueContainer
的 IBOutlet
。从父 UIViewController
到子 UIViewController
添加一个具有类 RamblerEmbedSegue
的转换。将其标识符设置为 EmbedSegueExample
。
在父 UIViewController
中实现方法 - (UIView*)viewForEmbedIdentifier:(NSString*)embedIdentifier
并返回其中的 embedSegueContainer
- (UIView*)viewForEmbedIdentifier:(NSString*)embedIdentifier {
if ([embedIdentifier isEqualToString:@"EmbedSegueExample"]) {
return self.embedSegueContainer;
}
return nil;
}
Router
使用 ViperMcFlurry。在第一个 Storyboard 上添加一个新的空 UIViewController
。将其类设置为 RamblerPlaceholderViewController
,将恢复标识符设置为 SecondViewController@AnotherStoryboard
。
UIViewController
添加一个具有类 CrossStoryboardSegueExample
和标识符 CrossStoryboardSegueExample
的转换到该占位符。AnotherStoryboard
。将其 Storyboard ID 设置为 SecondViewController
。再次享受 - 您可以使用这个转换,就像使用任何一个一样,但它将会从另一个 Storyboard 打开 UIViewController
。
[self performSegueWithIdentifier:@"CrossStoryboardSegueExample" sender:self];
您可以在示例项目中测试这两个转换 - 首先克隆仓库,然后从 Example 目录运行 pod install
。
RamblerSegues 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile
pod "RamblerSegues"
RamblerSegues 在 MIT 许可协议下可用。有关更多信息,请参阅 LICENSE 文件。
Andrey Zarembo-Godzyatskiy, [邮箱地址隐藏]