2

Apple recommends to use a single storyboard for universal apps through size classes. Now I am trying to adapt the UI depending on the device, which has worked quiet well so far. The only problem I'm facing is how to assign the specific segues. For instance the settings, which in my App consist of only two tableview cells, should be made visible via a "present as a popover" on the iPad and a regular "show (e.g. Push)" segue on the iPhone.

Is there any way to define it just like that using storyboards or do I need to write supporting code?

Nick

Nick Podratz
  • 652
  • 9
  • 18

1 Answers1

1

In WWDC session Apple engineer used "Present as popover" segue. This one shows view modally on iPhone and popover on iPad. Though, you'll have to write some code to show Back button on iPhone.

If you need to have popover and push segues, I'd do that in code this way:

  1. Make 2 segues 'Present as popover' and 'Show'
  2. Set up segue identifiers
  3. In code identify whether app running on iPhone or iPad
  4. Launch correct segue
Yaroslav
  • 2,435
  • 1
  • 19
  • 36
  • My app is supposed to be down-compatible until iOS6. Is the method used by the Apple engineer perhaps just available for iOS8? When I try to use "Present as popover" while using the app on iPhone it crashes instead of eluding to a different segue. – Nick Podratz Jul 24 '14 at 11:49
  • Oh, sorry. Then you should get destination ViewController and launch segue from the code. Here is a good answer for popover http://stackoverflow.com/questions/13845508/is-it-possible-to-perform-a-popover-segue-manually-from-dynamic-uitableview-cel – Yaroslav Jul 24 '14 at 15:11