I'm currently playing around with sizeClasses and iOS8 and I've noticed what I believe could be a bug (not sure if it's limited to the simulator or devices as well) but wanted to check here first.
Using the standard "Master-Detail" template when starting a new project, I've noticed that the traitcollection appears to be inconsistent on the detailViewController depending on when you inspect it on an iPhone 6+ in landscape mode.
I've added in an NSLog on viewDidAppear
and willTransistionToTraitCollection
in the DetailViewController to view the traitCollection and these are the results
iPhone 6+ launched in landscape
View did appear trait collection <UITraitCollection: 0x7fe76b4895f0;
_UITraitNameUserInterfaceIdiom = Phone,
_UITraitNameDisplayScale = 3.000000,
_UITraitNameHorizontalSizeClass = Regular,
_UITraitNameVerticalSizeClass = Compact,
_UITraitNameTouchLevel = 0, _UITraitNameInteractionModel = 1>
iPhone 6+ launched in portrait, navigate to DetailViewController and rotateDevice
<UITraitCollection: 0x7fe76b7076e0;
_UITraitNameUserInterfaceIdiom = Phone,
_UITraitNameDisplayScale = 3.000000,
_UITraitNameHorizontalSizeClass = Compact,
_UITraitNameVerticalSizeClass = Compact,
_UITraitNameTouchLevel = 0,
_UITraitNameInteractionModel = 1>
As you can see if the phone is launched already in landscape mode, the detailViewController has a different traitCollection compared to rotating the device when on the same viewController. Is this a simulator bug? Or is this expected behaviour? If so it doesn't make sense for the sizeClasses when designing your layout.
** EDIT ** I can confirm I see the same behaviour on a physical device
thanks