详情请看官方文档
https://developer.apple.com/library/ios/recipes/xcode_help-IB_storyboard/chapters/StoryboardSegue.html
Adding a Segue Between Scenes in a Storyboard
Specify a transition from one scene to another by Control-dragging between them.
Segue Types
There are several types of constraints, some of which are unique to either OS X or iOS. On iOS, the segues are further divided into segues that adapt to size classes and the older, and now deprecated types. You should avoid using the deprecated segues on iOS. The only possible reason to use them is supporting iOS versions less than iOS 8.
The following two tables list the types of segue for each platform including the name, interface builder symbol, and a brief description.
| Name | Interface Builder Symbol | Description |
|---|---|---|
| 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 ( |
| 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 ( |
| Custom | | A custom segue enabling you to write your own behaviors. |
| Push (Deprecated) | | Present the content by pushing it onto the current stack of view controllers. |
| Modal (Deprecated) | | Present the content modally on top of the existing screen. The options are the same as Present Modally. |
| Popover (Deprecated) | | Present the content as a popover. The options are the same as Present as Popover. |
| Replace (Deprecated) | | Replace the top view controller on the screen with the new content. |
| Name | Interface Builder Symbol | Description |
|---|---|---|
| Show | | Present the content in a new window. |
| Modal | | Present the content as a modal dialog. |
| Popover | | Present the content as a popover anchored to an existing view. There are options to specify the behavior ( |
| Sheet | | Present the content as a sheet attached to the originating window. |
| Custom | | A custom segue enabling you to write your own behaviors. |
本文介绍如何在iOS的故事板中使用segue实现不同场景间的过渡。通过Control-drag操作可以轻松建立视图控制器之间的连接,并选择不同的过渡类型,如显示、模态呈现等。文章还详细列举了iOS和OSX平台上的segue类型及其特点。
4516

被折叠的 条评论
为什么被折叠?



