Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 360
nosuic Avatar asked Dec 31 '10 12:12

nosuic


1 Answers

-(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 */
                      }];
    }

}
like image 193
Felix Avatar answered Oct 06 '22 03:10

Felix