There are four kinds of segue in interface builder:
This type of segue just presents the new content modally over the source view controller. Some view controllers specifically override the method and use it to implement different behaviors. For example, a navigation controller pushes the new view controller onto its navigation stack.
use:
modalPresentationStyle
and modalTransitionStyle
property.func showViewController(_ vc: UIViewController, sender sender: AnyObject?)
.This segue is relevant only for view controllers embedded inside a UISplitViewController object. With this segue, a split view controller replaces its second child view controller (the detail controller) with the new content. Most other view controllers present the new content modally.
(difference from Show(push): no override in case of navigation controller)
use:
modalPresentationStyle
and modalTransitionStyle
property.func showDetailViewController(_ vc: UIViewController, sender sender: AnyObject?)
.This segue displays the view controller modally using the specified presentation and transition styles. The view controller that defines the appropriate presentation context handles the actual presentation.
use:
modalPresentationStyle
and modalTransitionStyle
property.func presentViewController(_ viewControllerToPresent: UIViewController, animated flag: Bool, completion completion: (() -> Void)?)
.In a horizontally regular environment, the view controller appears in a popover. In a horizontally compact environment, the view controller is displayed using a full-screen modal presentation.
use:
Presenting a View Controller in a Popover
Reference: