3D Coin Flipping Animation on SKSpriteNode
<p>I'm currently developing a game using Swift 3 and SpriteKit. I have a coin that falls during a game that the user can collect. Right now, it falls and doesn't have any rotation or anything. I want to add a 3D spinning effect while it falls. This effect should be a rotation around the y-axis . I'm not sure how to create a 3D effect like this or if I should be using another program.</p>

<p>I've found what I'm looking for on another stack overflow post but it's in objective-c:</p>

<p><a href="https://stackoverflow.com/questions/22219459/spinning-an-image-around-like-a-coin">Spinning an image like a coin</a></p>

<p>I've found a way to do this (from the link) with Core Animations/ Core Graphics, but I don't know how to make it work on an SKSpriteNode. </p>

<pre><code>    var coinFlip = CATransition()
    coinFlip.startProgress = 0
    coinFlip.endProgress = 1.0
    coinFlip.type = "flip"
    coinFlip.subtype = "fromRight"
    coinFlip.duration = 0.5
    coinFlip.repeatCount = 2

    yourView.layer.addAnimation(coinFlip, forKey: "transition")
</code></pre>

<p>This last line only works on UIViews and therefore causes errors when I try to run it on an SKSpriteNode.</p>

<p>If someone could explain to me how to do this and/or show me another way of creating this animation for an SKSpriteNode it would be greatly appreciated.</p>