I need to set zoomScale back to 1 on a UIScrollView, but I need it to be animated. I thought I could use CABasicAnimation for this, but NSValue doesn't seem to have a "valueForFloat" or "valueForNSNumber", so I'm not sure what to use for animation.fromValue and animation.toValue for the CABasicAnimation. Is there a better way to go about this?
EDIT: What do I need to add for this to work?
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"zoomScale"];
animation.duration = 2.3;
animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
animation.fromValue = [NSNumber numberWithFloat:myScrollview.zoomScale];
animation.toValue = [NSNumber numberWithFloat:1.0];
[myScrollview.layer addAnimation:animation forKey:@"zoomScale"];