2

UIScreen in iOS 8 is now interface oriented (Is [UIScreen mainScreen].bounds.size becoming orientation-dependent in iOS8?).

My app runs in landscape mode only — so in iOS 7 and iOS 8 the values for bounds.size.width and bounds.size.height will be switched. In order to support iOS 7 and iOS 8, does this mean that in my code, I need to detect either the version of iOS (or for example assign the larger of the two dimensions to my 'width' variable and the shorter to the 'height' variable)? I should add that I'm creating views programmatically.

Community
  • 1
  • 1
pingin
  • 482
  • 1
  • 6
  • 19
  • 1
    I've had this problem where you are flipping the width and height values for rotations, it sounds like it's made simpler in iOS 8 but it's probably best practice to check the iOS version and if it's <8.0 then flip them as you would before – GroovyCarrot Sep 23 '14 at 09:05

1 Answers1

2

Yes, you would need to programmatically check the OS version and return the appropriate value. Here's one way to check: How can we programmatically detect which iOS version is device running on?.

Community
  • 1
  • 1
Eddie K
  • 503
  • 4
  • 18
  • 1
    Thanks. I think rather than detect the version though, I will just calculate which is larger and then assign the width to the larger of the two values. – pingin Sep 23 '14 at 10:11