[animationImageView setWantsLayer:YES];
CAKeyframeAnimation *keyframeAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"];
keyframeAnimation.values = [animationsBindingsController valueForKeyPath:@"selection.controlPoints"];
keyframeAnimation.duration = 5;
[animationImageView.layer addAnimation:keyframeAnimation forKey:@"position"];
[pageContent addSubview:animationImageView];
AnimationImageView
是 的子类NSImageView
。
animationImageView
对象消失 5 秒(动画持续时间),然后突然出现在初始位置。