Use present as popover in a universal storyboard

情到浓时终转凉″ 提交于 2020-01-02 09:29:13

问题


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


回答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


来源:https://stackoverflow.com/questions/24916584/use-present-as-popover-in-a-universal-storyboard

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!