码迷,mamicode.com
首页 > 其他好文 > 详细

Chapter 28 UIStoryboard

时间:2014-10-07 20:49:34      阅读:141      评论:0      收藏:0      [点我收藏+]

标签:des   style   io   ar   for   sp   c   on   cti   

Chapter 28 UIStoryboard

 

1. A segue moves another view controller’s view onto the screen when triggered and is represented by an instance of UIStoryboardSegue. Each segue has a style, an action item, and an identifier. The style of a segue determines how the view controller will be presented, such as pushed onto the stack or presented modally. The action item is the view object in the storyboard file that triggers the segue, like a button, a bar button item, or another UIControl. The identifier is used to programmatically access the segue. This is useful when you want to trigger a segue that does not come from an action item, like a shake or some other interface element that cannot be set up in the storyboard file.

 

2. Whenever a segue is triggered on a view controller, it gets sent the message prepareForSegue:sender:. This method gives you both the UIStoryboardSegue, which gives you information about which segue is happening, and the sender, which is the object that triggered the segue (a UIBarButtonItem or a UITableViewCell, for example). The segue gives you three pieces of information to use: the source view controller (where the segue is originating from), the destination view controller (where you are segueing to), and the identifier of the segue. The identifier is how you can differentiate the various segues. Let’s give your two segues useful identifies.

Chapter 28 UIStoryboard

标签:des   style   io   ar   for   sp   c   on   cti   

原文地址:http://www.cnblogs.com/1oo1/p/4009701.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!