So I have a button with an IBAction which is supposed to display a subview. The view is in the storyboard and I'm calling it was instantiateViewController. This works fine. I would like to animate the views transition onto the screen which is where I hit this problem. The following code is what I have however all it does is display the entire view at once but without text on buttons etc. and then drags the text down from the top. Quite obscure. Commenting out the setAnimationTransition line heralds the same result.
MapViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"MapViewController"];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:MapViewController.view cache:YES];
[self.view addSubview:MapViewController.view];
[UIView commitAnimations];
Anybody have any ideas?
Your help is much appreciated.
Thanks.
As per the comment below I have changed it to:
[UIView animateWithDuration:0.5 delay:0.0 options:UIViewAnimationOptionTransitionFlipFromRight animations:^{[self.view addSubview:MapViewController.view];} completion:NULL];
However the problem still persists.