nosuic
nosuic

Reputation: 1360

UIView TransitionFromView example?

I would like to use UIView's transitionFromView method to animate a view and catch the event when it is completed. Could some post an example?

Thank you!

F.

Upvotes: 5

Views: 13532

Answers (1)

Felix
Felix

Reputation: 35384

-(IBAction) anAction:(id) sender {
    // assume view1 and view2 are some subviews of self.view
    // view1 will be replaced with view2 in the view hierarchy
    [UIView transitionFromView:view1 
                        toView:view2 
                      duration:0.5 
                       options:UIViewAnimationOptionTransitionFlipFromLeft   
                    completion:^(BOOL finished){
                        /* do something on animation completion */
                      }];
    }

}

Upvotes: 17

Related Questions