What's the difference between all the Selection Segues?
2015-07-14 17:00
411 查看
Here is a quick summary of the segues and an example for each type. You'll want to do more research/experimentation if you decide to implement them.
Show - Pushes the destination view controller onto the navigation stack, moving the source view controller out of the way (destination slides overtop from right to left), providing a
back button to navigate back to the source - on all devices
Example: Navigating inboxes/folders in Mail
Show Detail - Replaces the detail/secondary view controller when in a
no ability to navigate back to the previous view controller
Example: In Mail on iPad in landscape, tapping an email in the sidebar replaces the view controller on the right to show the new email
Present Modally - Presents a view controller in various different ways as defined by the Presentation option, covering up the previous view controller - most commonly used to present
a view controller that animates up from the bottom and covers the entire screen on iPhone, but on iPad it's common to present it as a centered box overtop that darkens the underlying view controller and also animates up from the bottom
Example: Tapping the + button in Calendar on iPhone
Popover Presentation - When run on iPad, the destination appears in a small popover, and tapping anywhere outside of this popover will dismiss it. On iPhone, popovers are supported as
well but by default if it performs a Popover Presentation segue, it will present the destination view controller modally over the full screen.
Example: Tapping the + button in Calendar on iPad (or iPhone, realizing it is converted to a full screen presentation as opposed to an actual popover)
Custom - You may implement your own custom segue and have control over its behavior.
The deprecated segues are essentially the non-adaptive equivalent of those described above. These segue types are deprecated in iOS 8: Push, Modal, Popover, Replace.
For more info, you may read over this documentation which
also explains the types of segues and how to use them in a Storyboard. Also check out Building Adaptive Apps with UIKit - Session 216, that Apple presented at WWDC 2014. They talked about how you can build adaptive apps using these new Adaptive Segues, and
they built a demo project that utilizes these segues.
Show - Pushes the destination view controller onto the navigation stack, moving the source view controller out of the way (destination slides overtop from right to left), providing a
back button to navigate back to the source - on all devices
Example: Navigating inboxes/folders in Mail
Show Detail - Replaces the detail/secondary view controller when in a
UISplitViewControllerwith
no ability to navigate back to the previous view controller
Example: In Mail on iPad in landscape, tapping an email in the sidebar replaces the view controller on the right to show the new email
Present Modally - Presents a view controller in various different ways as defined by the Presentation option, covering up the previous view controller - most commonly used to present
a view controller that animates up from the bottom and covers the entire screen on iPhone, but on iPad it's common to present it as a centered box overtop that darkens the underlying view controller and also animates up from the bottom
Example: Tapping the + button in Calendar on iPhone
Popover Presentation - When run on iPad, the destination appears in a small popover, and tapping anywhere outside of this popover will dismiss it. On iPhone, popovers are supported as
well but by default if it performs a Popover Presentation segue, it will present the destination view controller modally over the full screen.
Example: Tapping the + button in Calendar on iPad (or iPhone, realizing it is converted to a full screen presentation as opposed to an actual popover)
Custom - You may implement your own custom segue and have control over its behavior.
The deprecated segues are essentially the non-adaptive equivalent of those described above. These segue types are deprecated in iOS 8: Push, Modal, Popover, Replace.
For more info, you may read over this documentation which
also explains the types of segues and how to use them in a Storyboard. Also check out Building Adaptive Apps with UIKit - Session 216, that Apple presented at WWDC 2014. They talked about how you can build adaptive apps using these new Adaptive Segues, and
they built a demo project that utilizes these segues.
相关文章推荐
- iOS UITableView Cell动态高度(使用AutoLayout)
- UISwitch学习记录
- SUI
- iOS开发笔记--如何去掉UItableview header(footer)view黏性(sticky)
- StringBuilder与StringBuffer的区别
- Android开发UI之常用控件的使用
- Sublime Text Build System——编译运行Java
- iOS开发概述UIkit动力学
- Gradle DSL method not found: 'zipAlign()'/'runProguard()'/'jniDebugBuild()'/ 'renderscriptDebug()'
- Builder模式(创建类)
- EasyUI实现二级页面的内容勾选的方法
- Funambol Developer's Guide 中 connector development例子的问题
- 【一步一步的积累】Synthetic Minority Over-sampling TEchnique
- ios UIView的clipsTobounds属性
- maven install与maven build的区别
- solr权重 之function query(函数式查询)
- UIWindow的层级问题Level
- uibutton的单选和多选
- Unigui的Grid添加汇总栏
- UITableViewCell分割线不到头的解决办法