Open CHPraxis opened 8 years ago
It's been several years since I wrote this logic, but if I remember correctly, it's because I was having an issue with handling rotation for all cases/platforms. I'm sure a lot of things have changed/been fixed since I wrote this particular section. :smile: Specifically, in iOS 7 or so, your application's window no longer had a transform applied to it, and the window's frame returned the correct values regardless of orientation. This was not always the case in older versions of iOS, though, which is probably what you're seeing here.
:beers:
Are there any plans to port the orientation checks to proper trait collection handling and autolayout constraints?
This works great! Thank You for the fix. Any plans to merge this in via PR?
So, what's happening is that your code checks if it is landscape or portrait, then if landscape, takes the larger of the height and width as the height. If the user is in landscape, but is using split view (therefore, height is larger than width), the iAd container gets the wrong result and the container starts floating in the middle.
I'm not sure why this logic exists; it seems like, if the user is in landscape, you can simply use the height as height, right? So, I tweaked your code to remove this logic. I commented out two lines and replace them with my lines beneath them. This is the part I modified.
Let me know if there's anything wrong with it? This is in LARSAdController.m .