How can I rotate and translate a UIImageView off one side of the screen, then its coming back from the other side.. Lets say I have a Wheel that I want to rotate and translate from the middle then off the screen to the left, then its "coming back" from the right side and back the middle..
I used following code to rotate and translate it OFF the screen;
CABasicAnimation* rotationAnimation;
rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
rotationAnimation.toValue = [NSNumber numberWithFloat: -M_PI * 2.0 /* full rotation*/ * 2 * 1 ];
rotationAnimation.duration = 1;
rotationAnimation.cumulative = YES;
rotationAnimation.repeatCount = 1.0;
rotationAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
rotationAnimation.delegate = self;
CABasicAnimation* translationAnimation;
translationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.translation.x"];
translationAnimation.toValue = [NSNumber numberWithFloat:-700];
translationAnimation.duration = 1;
translationAnimation.cumulative = YES;
translationAnimation.repeatCount = 1.0;
translationAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
translationAnimation.removedOnCompletion = NO;
translationAnimation.fillMode = kCAFillModeForwards;
Dunno if this is the right way to go, so please help!