Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

View controller frame.height and frame.width are swapped for iOS 8

Tags:

ios

view

ios8

I'm updating an app which runs in landscape and I'm testing in the simulator and on an iPhone 5 running iOS 8. The results from my view controller's value for self.view.frame.size.width are the values I've always received for self.view.frame.size.height in iOS 7 and earlier. Many elements now show with the x and y coordinates now flipped accordingly.

I'm looking for an elegant solution which gets the same behavior as before, perhaps this is not possible with iOS 8 in landscape mode?

like image 477
rowdyruckus Avatar asked Sep 29 '22 20:09

rowdyruckus


1 Answers

As pointed by the user nyekimov, it's a new behavior of iOS 8. There was something related in WWDC 2014 Session 214. Hope this reference helps :) To solve the problem I just added a verification of iOS 8 and iPad and swapped the width with height. (I just got this problem on iPad, that's why I made only for it)

Good luck ! :D

like image 134
Renan Kosicki Avatar answered Oct 03 '22 06:10

Renan Kosicki