Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the differences between segues: "show", "show detail", "present modally", "present as popover"? [closed]

What do the different segues do in Xcode 6?

like image 417
Red Avatar asked Oct 09 '14 20:10

Red


People also ask

What is present Modally?

Present Modally - Presents a view controller overtop the current view controller in various fashions as defined by the modal presentation and transition style - most commonly used to present a view controller in a sheet that animates up from the bottom. Example: Selecting Face ID & Passcode in Settings.

What are segues in Swift?

Swift version: 5.6. Segues are visual connectors between view controllers in your storyboards, shown as lines between the two controllers. They allow you to present one view controller from another, optionally using adaptive presentation so iPads behave one way while iPhones behave another.

Why do we use segues?

This use of segue is defined in our Online Dictionary as "to make a transition without interruption from one activity, topic, scene, or part to another." This use comes from music—there, the direction segue means to proceed directly on to the next thing without stopping, or to perform the next piece of music like the ...

How do segues work?

Use segues to define the flow of your app's interface. A segue defines a transition between two view controllers in your app's storyboard file. The starting point of a segue is the button, table row, or gesture recognizer that initiates the segue. The end point of a segue is the view controller you want to display.


1 Answers

1. 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.

2. Show Detail - Replaces the detail/secondary view controller when in a UISplitViewController with 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.

3. 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 in a centered box format overtop that darkens the underlying view controller.

Example: Tapping the + button in Calendar on iPhone.

4. 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).

5. Custom - You may implement your own custom segue and have complete control over its appearance and transition.

like image 197
Rajesh Loganathan Avatar answered Nov 02 '22 23:11

Rajesh Loganathan