storyboard ID
The storyboard ID is a String field that you can use to create a new ViewController based on that storyboard ViewController. An example use would be from any ViewController:
//Maybe make a button that when clicked calls this method
- (IBAction)buttonPressed:(id)sender
{
MyCustomViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"MyViewController"];
[self presentViewController:vc animated:YES completion:nil];
}
This will create a MyCustomViewController based on the storyboard ViewController you named "MyViewController" and present it above your current View Controller
And if you are in your app delegate you could use
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard"
bundle: nil];
Edit: Swift
@IBAction func buttonPressed(sender: AnyObject) {
let vc = storyboard?.instantiateViewControllerWithIdentifier("MyViewController") as MyCustomViewController
presentViewController(vc, animated: true, completion: nil)
}
and
let storyboard = UIStoryboard(name: "MainStoryboard", bundle: nil)
storyboard ID的更多相关文章
- 关于xib文件和storyboard文件的那些事儿
在ios中,一般建议使用代码布局,因为使用代码布局,后期维护容易,拓展容易,并且可以实现动态加载很多数据,但是代码布局比较繁琐,不适合初学者.Xib布局或者Storyboard布局比较方便.下面介绍一 ...
- 用代码调用Storyboard里面的viewController
今天在帮助群里的一个朋友弄pop事件,在他那边,当前的viewcontroller,不能pop出去. 初步估计,他的ViewController层级多,他自己没有理清. 因为pushViewContr ...
- UIStoryboard类介绍(如何从Storyboard中加载View Controller)
如何从Storyboard中加载View Controller? 1. 首先了解下UIStoryboard类: @class UIViewController; @interface UIStoryb ...
- 故事板(Storyboard)
1 使用Storyboard完成各项常见功能 1.1 问题 故事板Storyboard是IOS5开始引入的一个新的系统,将多个视图文件(类似xib文件)集中到一个单独的可视化工作区间,负责创建和管理所 ...
- Storyboard 跳转 和 传值
因为苹果推 Storyboard 而且 目前来看, Apple Watch 也是用 Storyboard 就知道, 明天应用估计都是 Storyboard 的天下了. (水平有限, 不对之处在所难免, ...
- iOS之Storyboard References
如果你曾经使用 interface builder 创建过一个复杂.界面非常多的应用,你就会明白最后那些Storyboards 文件变的有多大.他会迅速变的无法管理,阻碍你的进度.自从引入 Story ...
- storyboard 总结
1.storyboard 布局时用代码实现页面跳转: a> 获取当前 storyboard : [self storyboard] b> 为将要跳转到的 viewController 添加 ...
- iOS开发-使用Storyboard进行界面跳转及传值
前言:苹果官方是推荐我们将所有的UI都使用Storyboard去搭建,Storyboard也是一个很成熟的工具了.使用Storyboard 去搭建所有界面,我们可以很迅捷地搭建出复杂的界面,也就是说能 ...
- iOS 开发 UI 搭建心得(一)—— 驾驭 StoryBoard
本系列文章中,我们将一起认识.了解当下 iOS 开发中几种常见的 UI 构建方式,分析他们分别适合的使用场景,以便让我们在以后的开发中,能够在恰当的时间.场景下做出最佳的选择,提升开发效率,增强程序的 ...
随机推荐
- shell实现查询oracle数据库表,并写到本地txt文件
1.表结构 create table t_student( id ) primary key, name ), birthday date ); increment ; insert into t_s ...
- ubuntu基本使用
sudo nautilus xxx指定目录去打开 这个命令就是以root权限打开一个窗口,来管理文件
- android程序的安装与卸载
Android android在安装应用程序与卸载应用程序时都会发送广播,安装应用程序成功时会发送android.intent.action.PACKAGE_ADDED广播,可以通过intent.ge ...
- open()函数
STDOUT_FILENO 1 标准输入 STDIN_FILENO 0 标准输出 STDERR_FILENO 2 标准错误 在/proc目 ...
- jQuery 滚动动画简单版
动画的思路很简单,点击页面上一个元素,页面滚动到指定位置.下面介绍一下我3个小时百度的研究成果: 首先是html部分: <html> <body> <a>顶部< ...
- ES6笔记-字符串方法
字符串检索方法,indexOf(searchValue,fromIndex)//参数1必需,检索查询的字符串或者值,参数2选题,规定检索的起始位置,不设置默认从0开始 indexOf()方法返回检索字 ...
- c#解决数据库用in的时候大于1000报错问题
问题: //oracle数据库报错 ,,,,,,,.....); c#写了一个方法解决 /// <summary> /// 拼接sql /// </summary> /// & ...
- php练习5——简单的学生管理系统(隐藏控件的使用)
要求: 程序:gradeManage.html和gradeManage.php 结果 注意: 1.使用隐藏控件时,得在不同表单下,不能在同一个表单下: 2. ...
- php文件上传大小限制设置
配置选项说明: upload_max_filesize 所上传的文件的最大大小. post_max_size 设定 POST 数据所允许的最大大小. memory_limit 设定了一个脚本所能够申请 ...
- java中抽象类与接口的区别
1.abstract class 在 Java 语言中表示的是一种继承关系,一个类只能使用一次继承关系.但是,一个类却可以实现多个interface. 2.在abstract class 中可以有自己 ...