Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between a custom UIStoryboardSegue and UIViewController transition

I am trying to find out what the difference is between a custom UIStoryboardSegue and a custom UIViewcontroller transition (introduced in ios7).

What are the differences and different use cases for both? As far as I can tell they are both used for custom moves to new controllers.

Possibly the UIViewcontroller transitions are used more for a controller that is only shown and will some point be dismissed, whilst the segue is a complete move and not necessarily a back?

Custom Segues
UIViewControllerTransitioningDelegate Protocol Reference

like image 400
StuartM Avatar asked Jan 14 '14 17:01

StuartM


People also ask

What is a relationship segue?

Relationships segues are different from the other segues in that they are resolved at build time. When a UITabBarController is loaded from a storyboard, all of its constituent view controllers are already 'inside' of it in the same NIB that represents the scene with the tab bar controller.

How can segues be executed in IOS application?

To create a segue between view controllers in the same storyboard file, Control-click an appropriate element in the first view controller and drag to the target view controller. The starting point of a segue must be a view or object with a defined action, such as a control, bar button item, or gesture recognizer.

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.


1 Answers

Custom Segues are not just for defining the presentation styles but they can also be used for defining custom hierarchy of view controllers along with presentation styles--something different from Navigation or Tab bar view controllers.

The issue with using custom segue only for presentation is that developer is responsible for managing the view controller hierarchy also, which is not actually the intent.

With custom transitions API, presentation is separated from how view controllers are managed.

like image 166
abir Avatar answered Oct 18 '22 20:10

abir