I need to add 3 labels to my UITableViewCell
when my phone is in portrait, but when it's in landscape mode it should display 5 labels
. Just to add complexcity when same cell
is in ipad landscape it should show 6 labels
. It should look something like this.
iPhone portrait
I can do this using diffrent UITableViewCell
XIB's but I want do this using Size classes and storyboard
. Is there any example / tutorial / suggestion to follow ?
What you're looking for is this tutorial by Apple:
This panel will install a given view for a given size class, in other words, make sure it exists or doesn't exist:
(source: apple.com)
This still doesn't give you the opportunity to change it for iPad specifically because the size classes aren't distinguishable but perhaps you could smuggle as I think the iPhone has it's height as Compact in that mode and the iPad and iPhone 6(S) Plus as Regular. So you need to add that extra label in the width looking at the combination of Regular width and height.
Also make sure you install the right layout constraints in more or less the same way as in one scenario you space to the next label while in the next scenario that label is gone and you need to space it to the right side.