Search code examples
ioscore-animationcalayer

Flip Animation Using Core Animation Showing Reversed Contents


Here is the result that I get:

enter image description here

If I set the doubleSided property of layer 4 as No, the whole layer disappears. I know that already. But then, how can I show yet with correct content orientation?


Solution

  • Do the animation in two parts. At the halfway point, when the layer is side-on to the camera so you can’t see it, flip the layer the other way around and move the anchor point to the other side, and swap out the contents of the layer if you need to.

    Unfortunately, I don’t have any sample code, because the last time I did this was on iOS 4, and the pile of hacks view-based animations that I was using don’t appear to work on layers any more. You could post your own code and accept your own answer if you want.