After rotating a CALayer using CABasicAnimation the layer jumps back to it's unrotated position

前端 未结 3 1520
忘掉有多难
忘掉有多难 2020-12-13 02:58

I am trying to create a falling coin. The coin image is a CALayer with 2 CABasicAnimations on it - a falling down and a rotation one. When the falling down animation gets to

3条回答
  •  Happy的楠姐
    2020-12-13 03:13

    I found that by setting : removedOnCompletion = NO;

    did not produce a visible leak in instruments, but did not get deallocated and was accumulating a small amount of memory. IDK if its my implementation or what, but by adding removeAllAnimations at the end of the animation seemed to clear out this tiny bit of residual memory.

    [myview.layer removeAllAnimations];
    

提交回复
热议问题