Reputation: 24902
I have a view with a subview in it. The subview will contain other views.
When the user clicks on the menu on the left side, the contents of the subview will be switched: the current view will be removed and a new one will be added.
I want to animate this with an effect similar to UIModalTransitionStyleFlipHorizontal. How can I do this, considering that it wont be a modal form (it wont cover the entire screen)?
Upvotes: 0
Views: 1233
Reputation: 63667
self.currentView.userInteractionEnabled = NO;
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.75];
[UIView setAnimationDelegate:self];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.currentView cache:YES];
[self.currentView removeFromSuperview];
[self.view addSubview:self.someOtherView];
[UIView commitAnimations];
self.view.userInteractionEnabled = YES;
self.currentView = self.someOtherView;
Upvotes: 1