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
?
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:
Show segue
Show detail segue
In case you don't know how a Split view controller is composed:
**************++++++++++++++++++
* * +
* * +
* master * detail +
* view * view +
* controller * controller +
* * +
* * +
**************++++++++++++++++++
On iphones it's presented like this (iPhone6+ landscape excluded)
****************
*++++++++++++++*
*+ +*
*+ +*
*+ +*
*+ detail +*
*+ view +*
*+ controller +*
*+ +*
*+ +*
*++++++++++++++*
****************
Both of Show segue
and 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 segue
and 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 segue
s, 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With