XCode 6 之后,segue选项的变化

转载请注明出处
http://blog.csdn.net/shuai1iu/article/details/41186819

答案源于StackOverFlow

push与modal被弃用后,分别被新的show与present modally取代,根据苹果文档,这些新segues更进一步的划分了其适应的类,旧有的push与Modal将仅可用于iOS8以下的版本。

下面链接指向的苹果文档给出了各种可用segues的详细解释,包括新旧各个选项

Adding a Segue Between Scenes in a Storyboard

为避免这个URL在未来发生变化,摘录文档内容如下

Show
根据当前屏幕中的内容,在master area或者detail area中展示内容。
例如:如果app当前同时显示master和detail视图,内容将会压入detail区域。
           如果app当前仅显示master或者detail视图,内容则压入当前视图控制器堆栈中的顶层视图。

Show Detail
在detail area中展现内容。
例如:即使app同时显示master和detail视图,那么内容将被压入detail区域
           如果app当前仅显示Master或者detail视图,那么内容将替换当前视图控制器堆栈中的顶层视图。

Present Modally
使用模态展示内容。属性面板中提供presentation style (UIModalPresentationStyle)与 transition style (UIModalTransitionStyle)两种选项

Present as Popover
在某个现有视图中的锚点处使用弹出框展示内容。这个选项可指定显示在弹出框视图一边上的箭头可用方向,同时也是指定锚点视图的一个选项。

理解:

Show 和 ShowDetail的区别主要“压入”和"替代"的区别,present Modally 和 popover和原来的推出方式类似。

=======================翻译水平有限,以下是原文====================================
As was mentioned before the "push" and "modal" segues were deprecated, and have been replaced by "show" and "present modally" respectively. According to Apple's documentation, the new segues have been further divided into segues that adapt to size classes. The older ones should only be used to support iOS versions older than iOS 8.
The document in the following link explains that and the description of all the available segues, old and new.
Adding a Segue Between Scenes in a Storyboard
In case the URL changes in the future, this is the explanation given for each new segue:
Show
Present the content in the detail or master area depending on the content of the screen. If the app is displaying a master and detail view, the content is pushed onto the detail area. If the app is only displaying the master or the detail, the content is pushed on top of the current view controller stack.
Show Detail
Present the content in the detail area. If the app is displaying a master and detail view, the new content replaces the current detail. If the app is only displaying the master or the detail, the content replaces the top of the current view controller stack.
Present Modally
Present the content modally. There are options to choose a presentation style (UIModalPresentationStyle) and a transition style (UIModalTransitionStyle).
Present as Popover
Present the content as a popover anchored to an existing view. There is an option to specify the possible directions of the arrow shown on one edge of the popover view (UIPopoverArrowDirection). There is also an option to specify the anchor view.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 9,959评论 0 23
  • 什么是面向对象: ECMAScript 有两种开发模式:1.函数式(过程化),2.面向对象(OOP)。面向对象的语...
    阿甘笔记阅读 187评论 2 2
  • 1、蛋白质缺乏:怕冷,肌肉松驰,胸部下垂,孕妇水肿,易长皱纹,发育不良,抵抗力下降,易感冒,易疲劳,生殖能力降低,...
    露露2008阅读 227评论 0 1
  • 没有预兆 像是冥冥中注定 愈飞愈高的风筝 断了线 无措 失落 扑面而来 它朝着太阳 翱翔 匆忙追赶 依旧...
    蓝桉_屿阅读 154评论 0 1
  • 其实一直以来不敢承认自己很多事都不行,现在要学会习惯很多不行,我确实不够努力不够坚持,心思很乱,记忆力也不行,但是...
    6186834d3810阅读 199评论 0 0