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.

你可能感兴趣的:(XCode 6 之后,segue选项的变化)