Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

when to use show Segues & when to use Show detail Segues [closed]

I am new to IOS Development and I am confused between when to use show segue & when to use Show detail segue. Both them are used in the default master-detail project.

So when do we use either of them? What is the best case to use show segue & when to use show detail segue?

like image 579
Aadil Keshwani Avatar asked Dec 18 '14 07:12

Aadil Keshwani


1 Answers

Show segue can be used with navigation controllers, they simply push viewControllers on your stack.

Show detail segue has only sense with split view controllers. Since you have two viewControllers inside your split view controller you can:

  • navigate in your master view controller by presenting (pushing, since the default project uses a navigationVC as master VC) view controllers with Show segue
  • show details in your detail view controller with Show detail segue

In case you don't know how a Split view controller is composed:

**************++++++++++++++++++
*            *                 +
*            *                 +
*   master   *      detail     +
*    view    *       view      +
* controller *    controller   +
*            *                 +
*            *                 +
**************++++++++++++++++++

BUT !

On iphones it's presented like this (iPhone6+ landscape excluded)

****************
*++++++++++++++*
*+            +*
*+            +*
*+            +*
*+   detail   +*
*+    view    +*
*+ controller +*
*+            +*
*+            +*
*++++++++++++++*
****************

Both of Show segueand Show detail segue are new to iOS8 & Xcode6, they are called adaptative segues, they behaves differently depending on the device type or the orientation.

Basically, Show segueand Show detail segue seems to do the same thing on iPhones, since there is no much space to present view controllers side by side.

Technically, you don't present details several times until you go back in your navigation. Only the master view controller should perform Show detail segues, a detail view controller should be a leaf in your navigation tree (but it's not forbidden to use a navigationVC as a leaf ;) )

Hope it helps.

like image 172
Crazyrems Avatar answered Nov 18 '22 23:11

Crazyrems