Guest User

Untitled

a guest
Apr 25th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. CABasicAnimation *positionAnimation = [CABasicAnimation animationWithKeyPath:@"position.x"];
  2. positionAnimation.toValue = [NSNumber numberWithFloat: self.backgroundImageView.layer.position.x - 50.0];
  3.  
  4. CABasicAnimation *widthAnimation = [CABasicAnimation animationWithKeyPath:@"bounds.size.width"];
  5. widthAnimation.toValue = [NSNumber numberWithFloat: self.backgroundImageView.bounds.size.width + 50.0];
  6.  
  7. CAAnimationGroup *resizeAnimationGroup = [CAAnimationGroup animation];
  8. resizeAnimationGroup.duration = 0.5;
  9. resizeAnimationGroup.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];
  10. resizeAnimationGroup.animations = [NSArray arrayWithObjects:positionAnimation, widthAnimation, nil];
Add Comment
Please, Sign In to add comment