私はCAAnimation
男ではありませんが、境界の基本的なアニメーションと組み合わせたCAKeyframeAnimation
に沿ったの組み合わせだと思います。UIBezierPath
私のベジエはまったく正しくありませんが、おそらく理解できるでしょう。だから、多分それは次のようなものです:
CGPoint center = CGPointMake(self.view.frame.size.width / 2.0, self.view.frame.size.height / 2.0);
CGRect finalRect = CGRectMake(0.0, 0.0, 75.0, 75.0);
CGPoint finalCenter = CGPointMake(25.0, 25.0);
UIBezierPath *path = [UIBezierPath bezierPath];
[path moveToPoint:center];
[path addCurveToPoint:finalCenter
controlPoint1:CGPointMake(self.view.frame.size.width, 0.0)
controlPoint2:CGPointMake(100.0, finalCenter.y)];
UIImage *image = [UIImage imageNamed:@"YOURIMAGE.png"];
NSAssert(image, @"Error loading image");
CALayer *imageLayer = [CALayer layer];
imageLayer.contents = (id)image.CGImage;
imageLayer.bounds = finalRect;
imageLayer.position = finalCenter;
[self.view.layer addSublayer:imageLayer];
CAKeyframeAnimation *animatePosition = [CAKeyframeAnimation animationWithKeyPath:@"position"];
animatePosition.path = [path CGPath];
animatePosition.duration = 2.0;
[imageLayer addAnimation:animatePosition forKey:@"arc"];
CABasicAnimation *animateBounds = [CABasicAnimation animationWithKeyPath:@"bounds"];
animateBounds.duration = 2.0;
animateBounds.fromValue = [NSValue valueWithCGRect:self.view.bounds];
animateBounds.toValue = [NSValue valueWithCGRect:finalRect];
[imageLayer addAnimation:animateBounds forKey:@"zoom"];