I started developing my app for iOS 6 and got it working there, now I am having to make sure it also supports iOS 5.1 so it will work on the iPad 1. The port was pretty easy, though only supporting landscape orientation is more of a pain in iOS 5 compared to how easy it is in 6. I'm left with one issue that I can't resolve.
I have the starting screen layout shown below and then when you press the 'Perform' button it should present another view controller modally, full screen. This is the code that the perform button calls in the parent view controller.
- (void)performButtonPressed:(UIImage *)notationImage {
self.performViewController = [[YHPerformViewController alloc] initWithImage:notationImage
recordingService:self.performanceRecordingService];
self.performViewController.modalPresentationStyle = UIModalPresentationFullScreen;
self.performViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentViewController:self.performViewController animated:YES completion:^{
[self.performViewController startPerformance];
}];
}
In iOS 6 this is fine. In iOS 5 all the right code seems to be called:
- loadView on the view controller being presented
- shouldAutorotateToInterfaceOrientation - to which I return YES
- my 'startPerformance' method is called and does its things
However the view doesn't actually appear on screen and all the views associated with view controllers higher up the hierarchy stay on screen (the shapes at the top and the navigation control). Only the view for the current view controller is faded out. Even weirder is that during the transition this view is rotated 90 degrees as it is fading out. I've included a screen capture below. If I change the modalPresentationStyle to UIModalPresentationFormSheet it kind of works apart from the expected issue of my full sized view not fitting.
Any thoughts?
Starting layout:
Weird rotation of subview during transition. Also the whole screen should be fading out, not just one view:
What was expected to happen and does in iOS 6.