views:

20

answers:

0

Hi, With the following code I'm able to rotate the layer based on the left side. But how can I rotate it based on the right side?

Thank you, Jose.

  CALayer *layer = [masterTasksLeftSideView layer];

 [layer removeAllAnimations];


 CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.y"];

 CATransform3D transform = CATransform3DMakeRotation(M_PI, 0.0, 1.0f, 0.0f);


 transform.m34 = .001f;

 NSValue *value = [NSValue valueWithCATransform3D:transform];

 [animation setFromValue:value];




 transform = CATransform3DMakeRotation(0, 0.0f, 0.0f, 0.0f);

 value = [NSValue valueWithCATransform3D:transform];



 [animation setToValue:value];

 animation.removedOnCompletion = NO;

 [animation setDuration:3.f];

 animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];

 animation.fillMode = kCAFillModeForwards;


 [layer addAnimation:animation forKey:@"whatever"];