-(void)startAnimationWithTime:(CGFloat)animationTime
fromPoint:(CGPoint)fromPoint
toPoint:(CGPoint)toPoint
Completion:(SYBDanmakuAnimationCompletion)completion
{
[CATransaction begin];
[CATransaction setDisableActions:YES];
[CATransaction setCompletionBlock:^{
completion(YES);
}];
CABasicAnimation *mover = [CABasicAnimation animationWithKeyPath:@"position"];
[mover setDuration:animationTime];
[mover setFromValue:[NSValue valueWithCGPoint:fromPoint]];
[mover setToValue:[NSValue valueWithCGPoint:toPoint]];
[self addAnimation:mover forKey:@"move"];
[CATransaction commit];
}
这是myLayer的代码,当我更改其superLayer的框架时,此动画将立即完成,谁能告诉我原因?我希望它能正常工作。