Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You need to use Core Animation on the view layer instead of using the UIView animation proxy. <a href="http://developer.apple.com/mac/library/DOCUMENTATION/GraphicsImaging/Reference/CAKeyframeAnimation_class/Introduction/Introduction.html" rel="nofollow noreferrer">CAKeyframeAnimation</a> will enable you to create key frames for your animation and it enables you to specify key times (keyTimes property in the CAKeyframeAnimation class) that determine how much time it should take between key frames.</p> <p>The trick there is that your first key frame will not be the end transform, but rather some intermediate value for the transform. Your final key frame will have your ending transform. You specify with the key time when the next key frame should begin. If your total duration is 40 seconds and you want the first change in speed to occur 10 seconds into the animation, you specify that change as your second key frame value and specify 0.25 as your key time assuming you wanted it to take a quarter of the full duration.</p> <p>From the docs:</p> <blockquote> <p>keyTimes</p> <p>An optional array of NSNumber objects that define the duration of each keyframe segment.</p> <p>@property(copy) NSArray *keyTimes</p> <p>Discussion</p> <p>Each value in the array is a floating point number between 0.0 and 1.0 and corresponds to one element in the values array. Each element in the keyTimes array defines the duration of the corresponding keyframe value as a fraction of the total duration of the animation. Each element value must be greater than, or equal to, the previous value.</p> <p>The appropriate values in the keyTimes array are dependent on the calculationMode property.</p> <p>If the calculationMode is set to kCAAnimationLinear, the first value in the array must be 0.0 and the last value must be 1.0. Values are interpolated between the specified keytimes.</p> <p>If the calculationMode is set to kCAAnimationDiscrete, the first value in the array must be 0.0.</p> <p>If the calculationMode is set to kCAAnimationPaced, the keyTimes array is ignored.</p> <p>If the values in the keyTimes array are invalid or inappropriate for the calculationMode, the keyTimes array is ignored.</p> </blockquote> <p>Best regards.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload