Hi guys, I'm trying to animate a UIButton, seemingly sliding it out of the view, but when I do this with this class, upon completion, the UIButton snaps back to it's original place, how can I use this class to move something somewhere, but get it to stay there?
Code:
CABasicAnimation *theAnimation;
theAnimation=[CABasicAnimation animationWithKeyPath:@"transform.translation.x"];
theAnimation.duration=0.2;
theAnimation.repeatCount=0;
theAnimation.autoreverses=NO;
theAnimation.byValue=[NSNumber numberWithFloat:160];
[myButton.layer addAnimation:theAnimation forKey:@"animateLayer"];