I want to access get the value of the transform scale at a point in time. Here is the animation creation :
CABasicAnimation *grow = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
grow.toValue = @1.5f;
grow.duration = 1;
grow.autoreverses = YES;
grow.repeatCount = HUGE_VALF;
[view.layer addAnimation:grow forKey:@"growAnimation"];
I'd like to get, for example when a user presses a button, the current size of the view. Logging the frame or the bounds always returns constant values. Any help would be much appreciated !
The CALayer documentation describes presentationLayer
quite clearly:
The layer object returned by this method provides a close approximation of the layer that is currently being displayed onscreen. While an animation is in progress, you can retrieve this object and use it to get the current values for those animations.