问题描述:项目中用到 CAAnimationGroup
做动画,里面分别加入 CABasicAnimation
做缩放和透明度变化,用 CAKeyframeAnimation + UIBezierPath
做 position
的变化,运行代码后出现 CABasicAnimation
能呈现出效果,而 position
没变化。
几番查找,在 stack overflow看到网友提到可能是 copyWithZone:
方法导致的。
I encounter exactly problem as you did. Perhaps your project import some NSObject override class, such as RMMapper.
-(instancetype)copyWithZone:(NSZone *)zone {
typeof(self) copiedObj = [[[self class] allocWithZone:zone] init];
CGPath is not suitable for the copy zone.
Hoping this tip will help you.
share improve this answer follow
answered Dec 20 '17 at 7:23
Joey Z
随后测试,确实是项目加了NSObject
的 category
, 里面重写了 copyWithZone:
导致的。