Is there a way to figure out, how many degrees an view is rotated currently during an animation?

前端 未结 3 1385
被撕碎了的回忆
被撕碎了的回忆 2020-12-03 04:08

I am applying an rotation transform animation in an animation block with this transform:

CATransform3D rotatedTransform = self.layer.transform;
rotatedTransf         


        
3条回答
  •  悲哀的现实
    2020-12-03 04:53

    This is an old question but I came across this answer while trying to find the current rotation angle during a key frame animation:-

    CALayer* layer = [self.layer presentationLayer];
    float currentAngle = [[layer valueForKeyPath:@"transform.rotation.z"] floatValue];
    

    Seems to work for me. Also, nice and concise.

提交回复
热议问题