Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. UIImageView *view ;
  2. . . .
  3. view.frame = rect ;
  4. view.image = image ;
  5.  
  6. [iview1 removeFromSuperview] ;
  7. iview1.hidden = NO ;
  8. iview1.image = 0 ;
  9.  
  10.  
  11. [UIView animateWithDuration:5 animations:
  12. ^{
  13. scrollview.contentOffset = offset ;
  14. iview2.frame = rect ;
  15. } completion:^(BOOL finished) {
  16. iview2.image = image ;
  17. [scrollview addSubview:iview2] ;
  18. iview2.alpha = 1.0 ;
  19. }];
  20.  
  21. UIImageView* view;
  22. ...
  23. view.alpha = 0.0f;
  24. UIView animateWithDuration:0.2 animations:^{
  25. view.frame = rect;
  26. view.image = image;
  27. }completion:^(BOOL finished){
  28. view.alpha = 1.0f;
  29. }
  30.  
  31. [iview1 removeFromSuperview] ;
  32. iview1.hidden = YES;
  33. iview1.image = nil ;
  34.  
  35. [scrollview addSubview:iview2];
  36. iview2.alpha = 0;
  37. iview2.image = image ; //you could make this assignment in the completion block as well
  38.  
  39. [UIView animateWithDuration:5 animations:
  40. ^{
  41. scrollview.contentOffset = offset ;
  42. iview2.frame = rect ;
  43. } completion:^(BOOL finished) {
  44.  
  45. iview2.alpha = 1.0 ;
  46. }];
  47.  
  48. [iview1 removeFromSuperview];
  49.  
  50. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(NSEC_PER_SEC * 0.001)), dispatch_get_main_queue(), ^{
  51. [UIView animateWithDuration:5 animations:^{
  52. scrollview.contentOffset = offset;
  53. } completion:^(BOOL finished) {
  54. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(NSEC_PER_SEC * 0.001)), dispatch_get_main_queue(), ^{
  55. iview2.frame = rect;
  56. iview2.image = image;
  57. [scrollview addSubview:iview2];
  58. });
  59. }];
  60. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement