Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First of all, why are you avoiding removing the animation upon completion? You don't need these two lines,</p> <pre><code>animation.removedOnCompletion = NO; animation.fillMode = kCAFillModeForwards; </code></pre> <p>since you are actually setting the layer's transform property. Those two lines are what you would use if all you wanted was the final <strong>visual</strong> state after the animation while keeping the transform the same as the original (which frankly I've never had a use for).</p> <p>The next thing you have to realize is that you are setting the transform to the same value twice. Setting the transform on a layer is not additive by default. What I mean is that while you are expecting it to take your first transform and concatenating the same transform again from the final transform state, it doesn't work that way with the code you're using. You won't see a change because you're setting the state to the state it already has. </p> <p>I haven't tried it, but I think that you could probably take the first transform and concatenate the new one. Something like:</p> <pre><code>layer.transform = CATransform3DRotate(layer.transform, M_PI/8.0, 0, 0, 1); </code></pre> <p>Notice how I'm starting from the current transform on the layer (first parameter of CATransform3DRotate), instead of identity. Give that a try. If it doesn't work, try something like:</p> <pre><code>layer.transform = CATransform3DConcat(layer.transform, CATransform3DMakeRotation(M_PI/8.0, 0, 0, 1)); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

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