我发布
some code
不久前,这正是你想要的。基本上,您需要生成自己的
CGPathRef
包含希望层命中的所有点,并使用该路径
path
的属性
CAKeyframeAnimation
. 代码将如下所示:
CGPoint path[3] = {
FTAnimationOutOfViewCenterPoint(enclosingView.bounds, view.frame, view.center, direction),
[self overshootPointFor:view.center withDirection:direction threshold:(overshootThreshold_ * 1.15)],
view.center
};
CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"position"];
CGMutablePathRef thePath = CGPathCreateMutable();
CGPathAddLines(thePath, NULL, path, 3);
animation.path = thePath;
CGPathRelease(thePath);
整个方法是
here
.