Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. CGRect frame = Guy.frame;
  2. frame.origin.x = frame.origin.x - 0;
  3. frame.origin.y = frame.origin.y - 7;
  4.  
  5. [UIView beginAnimations:nil context:nil];
  6. [UIView setAnimationDuration:0.60];
  7. Guy.frame = frame;
  8. [UIView commitAnimations];
  9.  
  10. [UIView animateWithDuration:1.0
  11. delay: 0.0
  12. animations:^{
  13. image.frame = CGRectMake(image.frame.origin.x, image.frame.origin.y-7, image.frame.size.width, image.frame.size.height);
  14. }
  15. completion:^(BOOL finished){
  16. // move it ba
  17. [UIView animateWithDuration:1.0
  18. delay: 1.0
  19. options:UIViewAnimationOptionCurveEaseOut
  20. animations:^{
  21. image.frame = CGRectMake(image.frame.origin.x, image.frame.origin.y+7, image.frame.size.width, image.frame.size.height);
  22. }
  23. completion:nil];
  24. }];
  25.  
  26. CGRect frame = Guy.frame;
  27. [UIView animateWithDuration:0.6 delay: 0 options:UIViewAnimationCurveEaseInOut animations: ^{
  28. Guy.frame = CGRectMake(frame.origin.x, frame.origin.y - 7,
  29. frame.size.width, frame.size.height);
  30. } completion: ^(BOOL finished) {
  31. if (finished) {
  32. [UIView animateWithDuration:0.6 delay: 0 options:UIViewAnimationCurveEaseInOut animations: ^{
  33. Guy.frame = CGRectMake(frame.origin.x, frame.origin.y + 7,
  34. frame.size.width, frame.size.height);
  35. }];
  36. }
  37. }];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement