博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
跨Storyboard调用
阅读量:7027 次
发布时间:2019-06-28

本文共 827 字,大约阅读时间需要 2 分钟。

在开发中我们会有这种需求从一个故事板跳到另一个故事板

modal

1     UIStoryboard *secondStoryboard = [UIStoryboard storyboardWithName:@"Storyboard1" bundle:nil];//获取故事板2     UIViewController *firstVC = [secondStoryboard instantiateViewControllerWithIdentifier:@"firstVC "];//获取故事板中的页面3    [self presentViewController:firstVC animated:YES completion: nil];

push

1 UIStoryboard *secondStoryboard = [UIStoryboard storyboardWithName:@"Storyboard1" bundle:nil];2 UIViewController *firstVC = [secondStoryboard instantiateViewControllerWithIdentifier:@"firstVC "];3 [self.navigationController pushViewController:firstVC animated:NO];

注:获取故事板中的页面有两种方法

- (id)instantiateInitialViewController;//默认加载故事板中入口的页面

- (id)instantiateViewControllerWithIdentifier:(NSString *)identifier;//按照指定ID找页面,可以加载故事板中任意的页面

转载于:https://www.cnblogs.com/zhangjingyangjinjin/p/4624887.html

你可能感兴趣的文章
Windows Live Write 日志客户端
查看>>
把123456789转换为12-345-6789的三种方法
查看>>
Mysql选择合适的存储引擎
查看>>
URAL 1225 Flags
查看>>
UVa 11172 - Relational Operator
查看>>
UVa 10179 - Irreducable Basic Fractions
查看>>
日常会议
查看>>
SCP,SSH应用
查看>>
The first day to learn Englisht
查看>>
第二章 单表查询 T-SQL语言基础(1)
查看>>
C#中给RichTextBox加上背景图片
查看>>
竞赛准备篇---(四)子集生成
查看>>
JQuery判断复选框是否有选中
查看>>
ng之{{value}}顺序
查看>>
MSSQL 调用 .net 代码
查看>>
设计模式系列——单例模式 享元模式
查看>>
Web.xml详解(转)
查看>>
二分查找系列
查看>>
The Clocks
查看>>
Face++接口封装
查看>>