The following are the two layouts that I want have in my application. It would be nice if when the application switches from portrait to landscape that it keeps the UILabels, BOOLs, and other objects. Because the buttons are situated differently I cannot just have the portrait view autoresize on an auto rotate. I also want to implement my own rotation lock using a BOOL and the button on the top right.
I thought about using a -(void)orientationChanged:(NSNotification )notification with a presentModalViewController however these didn't copy over the objects and seemed to cause more harm then good and didn't appear to work properly.
Thanks for the help!
Attempted Solutions:
I added the landscape view to the ViewController, having both views in the view controller. I linked it up to File's Owner under the UIView *landscapeView that I added in the @interface section of the ViewController. I added [self.view addSubview:landscapeView] to the viewDidLoad method. Then I added this piece of code:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
if (orientationLock)
return NO;
else {
if (interfaceOrientation == UIInterfaceOrientationPortrait) {
[landscapeView setHidden:YES];
//[self.view setHidden:NO]; removed
} else {
//[self.view setHidden:YES]; removed
[landscapeView setHidden:NO];
}
return YES;
}
}
However this is not the correct solution. When I run the simulator and rotate it, the screen is not properly placed.