My son just discovered that he could hit my βFinishβ button, which flipped to its previous view, once to launch the flip and one or more times when the view is in transition (switching). The second and next hits will again trigger the same action, creating some interesting results, such as the lack of visible representations, but my main UIWindow interface.
I think I should call:
[coming.view setUserInteractionEnabled: NO]
on both representations associated with the flip transition, and then
[coming.view setUserInteractionEnabled: YES]
on the final presentation after the end of the animation.
I thought it might be better than it would be somehow to globally turn off the taps, while any view was in the process of transition. What do you think?
Here is the code for switching the whole code:
- (void)switchTwoViews:(UIViewController *)view1 otherView:(UIViewController *)view2 { UIViewController *coming = nil; UIViewController *going = nil; UIViewAnimationTransition transition; [view1.view setUserInteractionEnabled: NO]; [view2.view setUserInteractionEnabled: NO]; if (view1.view.superview == nil) { coming = view1; going = view2; transition = UIViewAnimationTransitionFlipFromLeft; } else { coming = view2; going = view1; transition = UIViewAnimationTransitionFlipFromRight; }
iphone uiviewcontroller
mahboudz
source share