UIView TransitionFromView example?
-
14-10-2019 - |
Question
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.
Solution
-(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 */
}];
}
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow