I am adding a view Controller to an existing one using addChildViewController and addSubview. The problem is that when the device is rotating the back view controller is briefly visible. I am using notifications to detect a rotation and replace the presented view controller (landscape and portrait are on different scenes in the storyboard)
- (void) changeTheViewToPortrait:(BOOL)portrait andDuration:(NSTimeInterval)duration{
if(portrait){
self.landscapeViewiPad.hidden = YES;
self.portraitViewiPad.hidden = NO;
}else{
self.landscapeViewiPad.hidden = NO;
self.portraitViewiPad.hidden = YES;
}
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:duration];
[UIView commitAnimations];
}
I notice that this problem is only on iOs8. Does anybody have an idea about what could be done to fix this.