1

I have the need to show a different view controller for compact vs regular size classes. The difference in views is too great for the regular use case. My app used to just work based off of iPad Storyboard vs iPhone Storyboard. On an iPhone it shows some text, and on an iPad it shows a PDF. Would I have to do this in code, by creating a different container view controller, or are Size Classes not the tool for this?

Jadar
  • 1,643
  • 1
  • 13
  • 25
  • Any luck on this? Please share your situation and how you proceeded, I am in a similar situation – Daniel Oct 07 '15 at 17:46

1 Answers1

0

I guess the better way to do this is by using separate storyboard for iPhone and iPad. We mainly use Size classes to have minor changes in UI element positions and constraints.

You can set the iPhone and iPad storyboards in your .plist using the keys

Main storyboard file base name (iPhone)

Main storyboard file base name (iPad)

Or if it is just one ViewController, then you can set it through code. Set two different view controllers in storyboard and instantiate the appropriate one based on size class. To identify your current size class, use my answer in Universal storyboard UITableview row Height.

Community
  • 1
  • 1
krishnanunni
  • 510
  • 7
  • 16