Can anyone give me a detailed explanation of why iOS is handling it's landscape orientation the way it does in regards to frame and transformation?
What I'm talking about is this following behavior displayed by logging the views description in the various View Lifecycle methods:
viewDidLoad: "UIView: 0x1edb5ba0; frame = (0 0; 568 320); autoresize = W+H; layer = <CALayer: 0x1edb5c50>"
viewWillAppear: "UIView: 0x1edb5ba0; frame = (0 0; 320 568); autoresize = W+H; layer = <CALayer: 0x1edb5c50>"
viewDidAppear: "UIView: 0x1edb5ba0; frame = (0 0; 320 568); transform = [0, 1, -1, 0, 0, 0]; autoresize = W+H; layer = <CALayer: 0x1edb5c50>"
The repercussions of this are subtle, but very intriguing.
For example, I launch my app with Initial Interface Orientation, and Supported Interface Orientations both set to "Landscape (right home button)"
I then display my rootViewController like this:
self.viewController = [[MyViewController alloc] initWithNibName:nil bundle:nil];
self.window.rootViewController = self.viewController;
This .xib has it's orientation set to Landscape and it's frame set to 0, 0, 568, 320. It displays correctly, and I can touch all points on the screen.
The issue then comes when I present a subview like so:
SomeView *someView = [[SomeView alloc] initWithFrame:self.view.frame];
[self.view addSubview:someView];
At this point in time, self.view.frame is reported as (0 0; 320 568) and self.view.transform is reported as transform = [0, 1, -1, 0, 0, 0]. Best case scenario, the end result is that I'm only able to touch the left 320px of the view I've just displayed, worst case is that the view's layout is butchered.
Thanks to various SO questions, I've learned that the proper way to do this is as follows:
SomeView *someView = [[SomeView alloc] initWithFrame:self.view.bounds];
[self.view addSubview:someView]
What I haven't learned is why, and I'm very curious about that.
What I'm even more curious about is why the view is manipulated the way it is during instantiation and display.
It's been quite awhile since I've tangled with a landscape only application, but for some reason I think the current implementation of this differs from earlier versions of iOS, is that correct?