1

My app is a universal app, i.e. the app is for iPhone_portrait and iPad_landscape.

I searched a lot about how to deal with iPhone and iPad, and I found that I can make my add adaptive using size classes, especially after IOS 8 size classes

my question is :

  1. Is this solution is a the best one, even if the design wan't simple?
  2. I have a lot of xib files in my app. Can I use size classes in this case? Or I need two xib one for iPhone, one for iPad?

thanks.

Community
  • 1
  • 1
Rawan
  • 1,589
  • 4
  • 23
  • 47
  • Size classes where create so you do not need two different files for iPhone to iPad. And yes you just change the NIB file to use the size classes, just enable size classes on the first tab for the nib property inspector. – rckoenes Jul 13 '15 at 13:49

1 Answers1

4

Yes you can use size class and AutoLayout. see the following screen shot there is tick mark on right side in File inspector.

enter image description here

Nitin Gohel
  • 49,482
  • 17
  • 105
  • 144
  • thanks for answer. but does that work even if the xib was for tableview cell, collectionView cell, .. because when i create it, there is a choice if i want it for iPad, or iPhone. – Rawan Jul 13 '15 at 13:56
  • you need to use auto-layout as well only size class in not enough – Nitin Gohel Jul 13 '15 at 13:59
  • what did you mean by auto-layout? – Rawan Jul 13 '15 at 14:00
  • Check what is autolayout https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/AutolayoutPG/Introduction/Introduction.html that manage subview's parent view – Nitin Gohel Jul 13 '15 at 14:01