facebookarchive / pop

An extensible iOS and OS X animation library, useful for physics-based interactions.
Other
19.66k stars 2.88k forks source link

Why not kPOPLayerRotationZ this enumeration? I want to rotate the animation around the Z axis. #397

Closed Jinxiansen closed 6 years ago

Jinxiansen commented 6 years ago

1

I only found kPOPLayerRotationX and kPOPLayerRotationY but no kPOPLayerRotationZ.

English is not my native language; please excuse typing errors.

DunnFu commented 6 years ago

This is a good note

Jinxiansen commented 6 years ago

I use the following code to meet the demand:


    POPBasicAnimation * basic = [POPBasicAnimation animationWithPropertyNamed:kPOPLayerRotation];
    basic.toValue = [NSNumber numberWithFloat: M_PI * 2.0];
    basic.duration = 2;
    basic.repeatForever = YES;
    basic.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
    basic.removedOnCompletion = NO;
    [self pop_addAnimation:basic forKey:@"refreshRotationKey"];

However, there is a doubt, view can not be added to the navigationBar, otherwise it will lead to animation deformation.😭