I managed to activate my UIView while moving its frame.origin.x from x to x-200; however, when frame.origin.x reaches x-200, I would like it to bounce back and forth a bit.
Are there any tips on how I should do this? thank
int targetX = 200;
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.1];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
myView.frame = CGRectMake(targetX, 0, [myView frame].size.width, [myView frame].size.height);
[UIView commitAnimations];
source
share