Guest User

Untitled

a guest
Jul 22nd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. // doesn't snap back, but doesn't respect the duration of the animation
  2. CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform"];
  3. NSValue *value = [NSValue valueWithCATransform3D:CATransform3DMakeRotation(M_PI, 1.0, 0.0, 0.0)];
  4.  
  5. animation.duration = 3.0;
  6. animation.fromValue = [NSValue valueWithCATransform3D:layer.transform];
  7. animation.toValue = value;
  8.  
  9. [layer addAnimation:animation forKey:@"transform"];
  10. [layer setValue:value forKey:@"transform"];
Add Comment
Please, Sign In to add comment