Can I detect if screen is regular or compact from code on iOS 8?

Yes you can, UIViewControllers now have a traitCollection property which has information from the device idiom, to the current size classes and more … Furthermore you can implement the method func traitCollectionDidChange(previousTraitCollection: UITraitCollection) to get notifications when the size class (or any trait) has changed (as when the user rotates the device on an iphone). The properties of UITraitCollection that you are looking for are horizontalSizeClass and verticalSizeClass ..Here is a reference

Hope that helps

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)