objcio / articles

All current objc.io articles
593 stars 122 forks source link

fix misleading words when set additive property #47

Closed studentdeng closed 10 years ago

studentdeng commented 10 years ago
CAKeyframeAnimation *animation = [CAKeyframeAnimation animation];
animation.keyPath = @"position.x";
animation.values = @[ @0, @10, @-10, @10, @0 ];
animation.keyTimes = @[ @0, @(1 / 6.0), @(3 / 6.0), @(5 / 6.0), @1 ];
animation.duration = 0.4;

animation.additive = YES;

[form.layer addAnimation:animation forKey:@"shake"];

above code doesn't change the value of model layer. I think it would be better if we modify this sentence

"Setting the additive property to YES tells Core Animation to add the values of the animation to the value of the model layer, before updating the presentation layer"

refer to CAPropertyAnimation Class Reference