You don’t need to resort to CAAnimation
for this simple thing, just use -[UIScrollView setZoomScale:animated:]
passing YES
as the second parameter.
Anyway, if you wanted to do modify some aspect of the animation you may resort using “UIView animations” instead, since zoomScale
is not directly a property animatable by CAAnimation
.
Have you tried something like the following?
[UIView animateWithDuration:2.0
delay:0
options:UIViewAnimationOptionBeginFromCurrentState
animations:^{ [myScrollView setZoomScale:1.0f animated:NO]; }
completion:nil];