RamblerSegues 1.1.2

RamblerSegues 1.1.2

测试已测试
Lang语言 Obj-CObjective C
许可协议 MIT
发布上次发布2016年10月

Andrey ZaremboEgor Tolstoy维护。



  • 作者:
  • Andrey Zarembo-Godzyatskiy

概述

RamblerSegues 是一系列定制的 UIStoryboardSegue 子类,适用于各种日常情况。

Segues

关键特性

  • EmbedSegue - 像应该一样轻松地呈现子 UIViewController
  • CrossStoryboardSegue - 如果您担心联接的 UIStoryboard,那么这个转换就是您完美的选择。

用法

EmbedSegue

  1. 在父 UIViewController 上添加一个 UIView - 这个视图将适合作为子模块的容器。将其链接到具有名称 embedSegueContainerIBOutlet
  2. 从父 UIViewController 到子 UIViewController 添加一个具有类 RamblerEmbedSegue 的转换。将其标识符设置为 EmbedSegueExample

    UIStoryboard

  3. 在父 UIViewController 中实现方法 - (UIView*)viewForEmbedIdentifier:(NSString*)embedIdentifier 并返回其中的 embedSegueContainer

    - (UIView*)viewForEmbedIdentifier:(NSString*)embedIdentifier {
      if ([embedIdentifier isEqualToString:@"EmbedSegueExample"]) {
          return self.embedSegueContainer;
      }
      return nil;
    }
  4. 享受吧 - 现在,您可以将管理子视图控制器转换,就像管理其他任何内容一样 - 即使是从 Router 使用 ViperMcFlurry

CrossStoryboardSegue

  1. 在第一个 Storyboard 上添加一个新的空 UIViewController。将其类设置为 RamblerPlaceholderViewController,将恢复标识符设置为 SecondViewController@AnotherStoryboard

    Placeholder UIViewController

  2. 从父 UIViewController 添加一个具有类 CrossStoryboardSegueExample 和标识符 CrossStoryboardSegueExample 的转换到该占位符。
  3. 将您的目标视图控制器添加到第二个 Storyboard - AnotherStoryboard。将其 Storyboard ID 设置为 SecondViewController
  4. 再次享受 - 您可以使用这个转换,就像使用任何一个一样,但它将会从另一个 Storyboard 打开 UIViewController

    [self performSegueWithIdentifier:@"CrossStoryboardSegueExample" sender:self];

您可以在示例项目中测试这两个转换 - 首先克隆仓库,然后从 Example 目录运行 pod install

安装

RamblerSegues 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile

pod "RamblerSegues"

许可协议

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

作者

Andrey Zarembo-Godzyatskiy, [邮箱地址隐藏]