我可以像这样动画地移动一个图层:
CABasicAnimation *animation = [CABasicAnimation animation];
[animation setFromValue:[NSValue valueWithCGPoint:self.layer.position]];
[animation setToValue:[NSValue valueWithCGPoint:CGPointMake(100, 100)]];
[self.layer addAnimation:animation forKey:@"position"];
self.layer.position = CGPointMake(100, 100);
但是,我必须在动画结束后设置 layer.position,有没有办法在使用显式动画时自动设置它?