Guest User

Untitled

a guest
Jan 21st, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. [UIView beginAnimations:nil context:nil];
  2. [UIView setAnimationDuration:3.0];
  3. [UIView setAnimationDelegate:self];
  4. [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
  5. transform = CGAffineTransformMakeScale(1,transformValue);
  6. image.transform = transform;
  7. image.center = CGPointMake(xValue, yValue);
  8.  
  9. [UIView commitAnimations];
  10.  
  11. [UIView animateWithDuration:3.0 delay:0.0 options:UIViewAnimationOptionCurveEaseInOut
  12. animations:^{
  13.  
  14.  
  15. UIImage *image = [UIImage imageNamed:@"button_connectMe.png"];
  16. CGImageRef tmpImgRef = image.CGImage;
  17. CGImageRef topImgRef = CGImageCreateWithImageInRect(tmpImgRef, CGRectMake(0, 30, image.size.width, image.size.height));
  18.  
  19. UIImage *topImage = [UIImage imageWithCGImage:topImgRef];
  20. imgView.image = topImage;
  21. imgView.frame = CGRectMake(0, 180, topImage.size.width, topImage.size.height);
  22.  
  23. }
  24. completion:^(BOOL finished) {
  25. NSLog(@"Final method");
  26.  
  27.  
  28. }
  29. ];
  30.  
  31. UIImage *topImage = [UIImage imageWithCGImage:topImgRef];
  32. imgView.image = topImage;
  33.  
  34. -(void)cropAnimateBottom
  35. {
  36. UIImage *image = [UIImage imageNamed:@"bar.png"];
  37. UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(150, 150, image.size.width, 0)];
  38. imageView.image = image;
  39. [imageView setClipsToBounds:YES];
  40. [imageView setContentMode:UIViewContentModeBottom];
  41.  
  42. [self.view addSubview:imageView];
  43.  
  44.  
  45. [UIView animateWithDuration:3.0f
  46. delay:0.0f
  47. options:UIViewAnimationOptionCurveEaseIn
  48. animations:^(void) {
  49. imageView.frame = CGRectMake(150, 150, image.size.width, -image.size.height);
  50. }
  51. completion:NULL];
  52.  
  53. }
  54.  
  55. -(void)cropAnimateTop
  56. {
  57. UIImage *image = [UIImage imageNamed:@"bar.png"];
  58. UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 100, image.size.width, 0)];
  59. imageView.image = image;
  60. [imageView setClipsToBounds:YES];
  61. [imageView setContentMode:UIViewContentModeTop];
  62.  
  63. [self.view addSubview:imageView];
  64.  
  65.  
  66. [UIView animateWithDuration:3.0f
  67. delay:0.0f
  68. options:UIViewAnimationOptionCurveEaseIn
  69. animations:^(void) {
  70. imageView.frame = CGRectMake(0, 100, image.size.width, image.size.height);
  71. }
  72. completion:NULL];
  73.  
  74. }
Add Comment
Please, Sign In to add comment