AAStoryboardInstantiate 0.0.2

AAStoryboardInstantiate 0.0.2

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

Doc Orkenstein 维护。



  • 作者
  • orkenstein

使用方法

  1. 在您需要的地方添加 #import <UIViewController+instantiate.h>。您的 .pch 文件是最好的位置。
  2. 为要使用的视图控制器设置 Storyboard ID。例如 @"MyCoolHomeScreen"Storyboard ID
  3. 现在您可以直接从 storyboards 中使用此代码实例化视图控制器
- (void)someAction {
    MyCustomVC *customVC = [MyCustomVC instantiateWithIdentifier:@"MyCoolHomeScreen"];
    //  Do something
    [self presentViewController:customVC animated:YES completion:nil];
}

...或者将 Storyboard ID 设置为与类名相同。例如 @"MyCustomVC"。并使用此方法

- (void)someAction {
    MyCustomVC *customVC = [MyCustomVC instantiateFromStoryboard];
    //  Do something
    [self presentViewController:customVC animated:YES completion:nil];
}

要求

与 iOS 7+ 一起工作。与 ARC 兼容。

安装

然后运行 pod installpod update

作者

orkenstein,[email protected]

许可证

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