Guest User

Untitled

a guest
Jun 19th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. -(void) reset
  2. {
  3. self.frame = CGRectMake(originalFrame.origin.x, originalFrame.origin.y, self.frame.size.width, self.frame.size.height);
  4. // [self animate];
  5. [self performSelector:@selector(animate) withObject: nil afterDelay: 0.0f];
  6. }
  7.  
  8. -(void) animate
  9. {
  10. [UIView beginAnimations:nil context:NULL];
  11. [UIView setAnimationDuration:5.0f];
  12. [UIView setAnimationCurve:UIViewAnimationCurveLinear];
  13. [UIView setAnimationBeginsFromCurrentState:YES];
  14.  
  15. CGRect aframe = self.frame;
  16. aframe.origin.x += (320.0f - aframe.size.width);
  17. self.frame = aframe;
  18.  
  19. [UIView commitAnimations];
  20. }
Add Comment
Please, Sign In to add comment