Reputation: 10348
I can pretty much do everything TransistionWithView can do with AnimationWithDuration. I'm really not sure when there is a use case to just one over the other.
What are the use case to use TransitionWithView over AnimateWithDuration?
Upvotes: 1
Views: 137
Reputation: 14030
[UIView transitionWithView:]
allows animating actions that aren't restricted to modifying values of animatable properties. For example:
[UIView transitionWithView:containerView
duration:0.2
options:UIViewAnimationOptionTransitionFlipFromLeft
animations:^{ [fromView removeFromSuperview]; [containerView addSubview:toView]; }
completion:NULL];
This allows you to animate the addition, removal, showing, or hiding of subviews where [UIView animateWithDuration:animations:]
only animates value changes for animatable properties.
Upvotes: 3