Introduction
Scene transitions are very common in applications, allowing the user to operate within one view controller, to instantiate and display another view controller, and to create a segue (transition) that is connected between the two. For example, in a navigation controller, a scene action can trigger a transition to load and display another scene, the transition can automatically push the next controller into the navigation stack.
Description
Xcode6 before storyboard several segue differences and view switches: Push, modal, popover, replace, and custom refer to: http://www.2cto.com/kf/201210 /161737.html
Xcode6 Segue cancel the original push and modal (deprecated), you can view the Official document description:https://developer.apple.com/library/ios/recipes /xcode_help-ib_storyboard/chapters/storyboardsegue.html
New methods Show and present modally are generally available to meet our needs
Show
Displays content in the master area or detail area based on the contents of the current screen.
For example: If the app currently displays both master and detail views, the content will be pressed into the detail area.
If the app currently displays only the master or detail view, the content is pressed into the top-level view in the current view controller stack.
Show Detail
Present content in the detail area.
For example: Even if the app displays both master and detail views, the content will be pressed into the detail area
If the app currently displays only the master or detail view, the content replaces the top-level view in the current view controller stack.
Present modally
Use modal display content. The presentation style (Uimodalpresentationstyle) and Transition style (Uimodaltransitionstyle) options are available in the Properties panel
Present as Popover
Use pop-up boxes to present content at anchor points in an existing view. This option specifies the available orientation of the arrows that appear on the side of the PopOver view, as well as an option to specify the anchor point view.
(Translation from netizens)
Storyboard Create Segue
hold down the right mouse button, drag the mouse pointer from a unit swatch to the new scene, and hover over the scene to see the highlight, indicating that you can connect. Release the right mouse button and select the Show option to pop up the selection segue location in the floating menu. Creating segue means that as long as the user taps the cell Swatch, the view controller connected to the other end allocates the memory space and prepares to switch.
Dynamic execution Segue
In the storyboard established in the segue, is the direct jump, inconvenient to add additional conditions to judge, if you want to do the landing and other functions, you must dynamically perform Segue operation
First build the segue in storyboard, not from the button and other controls, but from the Viewcontroller establishment, must specify the identifier, after the establishment, jump execution
[self performseguewithidentifier:@ " Seguexxx "sender:self";
Use identifier to specify the segue to perform
Passing Data with Segue
For example, to transfer data NSString *adata from Acontroller to Bcontroller, create a Bcontroller nsstring property in RecvData, and then add a method in Acontroller
- - (void) Prepareforsegue:(uistoryboardsegue *) Segue Sender:(id) sender {
- Uiviewcontroller *destination = Segue. Destinationviewcontroller;
- if ([Destination respondstoselector:@selector(SetData:)]) {
- [Destination setValue: AData forkey:@"recvdata"];
- }
- }
In the Bcontroller Viewdidload method, you can view the _recvdata value directly.
Summary of Segue usage in storyboard