1、shake
- CABasicAnimation *shake = [CABasicAnimation animationWithKeyPath:@"transform"];
- shake.duration = 0.13;
- shake.autoreverses = YES;
- shake.repeatCount = MAXFLOAT;
- shake.removedOnCompletion = NO;
- shake.fromValue = [NSValue valueWithCATransform3D:CATransform3DRotate(self.layer.transform,-rotation, 0.0 ,0.0 ,1.0)];
- shake.toValue = [NSValue valueWithCATransform3D:CATransform3DRotate(self.layer.transform, rotation, 0.0 ,0.0 ,1.0)];
- [self.layer addAnimation:shake forKey:@"shakeAnimation"];
转载于:https://blog.51cto.com/3507784/751263