我有一个包含CGPath的CAShapeLayer。使用iOS内置动画,我可以轻松地将这个路径转变成另一个路径:
CABasicAnimation *morph = [CABasicAnimation animationWithKeyPath:@"path"];
morph.fromValue = (id)myLayer.path;
mayLayer.path = [self getNewPath];
morph.toValue = (id)myLayer.path;
morph.duration = 0.3;
[myLayer addAnimation:morph forKey:nil];
这很完美。
然而,我现在想在拖动操作期间逐渐转换这些路径。为了做到这一点,我需要能够在拖动过程中的任何时刻检索插值路径。 有没有办法向iOS询问这个?