28
votes

I am new in iOS development and just studying Adaptivity and Layout I am stuck with a little confusion,

As per the Documentation

iOS defines two size classes:

  1. Regular :- It is associated with expansive space
  2. Compact :- It is associated with constrained space

By other references :

  1. All iPhones (top left) in the portrait orientation have a regular height and a compact width like Iphone in portrait

  2. Iphone 4, 5 and 6 in landscape orientation have compact height and compact width. iphones in landscape orientation

  3. But in case of iPhone 6 Plus, It has compact height and a regular width in landscape orientation.

    Iphone 6 plush in landscape

My Confusion is :

  • iPhone 4,5,6 have regular height and compact width in portrait mode but Why they don't have regular width and compact height in landscape orientation as it was reversed?
  • If so then why iPhone 6 plus is differ from them ? Is it because it's screen is 0.8" bigger then iPhone 6 ? Does it matters ?

Thanks in advance!, Warm welcome to editors!

I know it won't affect in development so far technically But I just want to make my mind clear of these things.

1
I think the key here is fact that plus models have landscape mode in general UIsage444
If you are wondering why the "Regular Height" of the smaller iPhones in portrait orientation does not translate to "Regular Width" when they are rotated to landscape, well... I guess Apple's expectations on What constitutes "Regular Width" are higher than for regular height. That's all I can think of. A bit arbitrary, if you ask me.Nicolas Miari
@sage444 I think maybe it's the other way around: because the 6+ has a regular (not compact) width in landscape orientation (due to it's screen size), it is allowed to display the landscape home screen (much like an iPad).Nicolas Miari
You'll never really get a satisfying answer to these sorts of questions. The answer to why it's done this way is that it's a human-made system and some human decided to do it that way.Wayne
I agree the 6 should have probably been regular width. You have to pay extra to get split view email on the plus, which is probably part of the reason.malhal

1 Answers

2
votes

If so then why iPhone 6 plus is differ from them ? Is it because it's screen is 0.8" bigger then iPhone 6 ? Does it matters ?

It matters when you are using a split view controller. When it has the same collapsed aspect on iPhone 5 and 6, it will split and show master and detail view controllers side by side in landscape orientation on iPhone 6+.

Size class illustration

It looks even more useless on iPad, since it has regular height and width size class on both portrait and landscape.

The point is, when you have regular size class, you should layout and show more content than on compact size class.

However size classes aren't related to the screen but to the view controller.

When you have your iPad with a master and a detail view controller, the master view controller has compact width/regular height, and the detail view controller has regular width/regular height.

You can still change child view controller's size classes by overriding them with

-(void)setOverrideTraitCollection:(UITraitCollection *)collection forChildViewController:(UIViewController *)childViewController

and

-(UITraitCollection *)overrideTraitCollectionForChildViewController:(UIViewController *)childViewController.

It's a key concept for iPad since you can now on iOS9 have your app running in compact width with the new multi-task feature (slide from the right of the screen).