title: How to animate transformation of CGPath in SKShapeNode?
body: <p>In my scene I use three basic shapenodes: squares, circles and triangles. I want to create a custom SKAction that animates the transformation from one shape kind to another.</p>
  
  <p>I am trying to recreate something like <a href="http://codepen.io/noahblon/blog/an-intro-to-svg-animation-with-smil" rel="nofollow">this</a> in SpriteKit. </p>
  
  <p>I'm using UIBezierPath to generate the CGPath for each shape:</p>
  
  <pre><code>//Circles
  UIBezierPath(ovalInRect: CGRect)
  
  //Squares
  UIBezierPath(rect: CGRect)
  
  //Triangles
  convenience init(triangleInRect:CGRect, centered:Bool) {
      self.init()
      var origin = CGPointZero
      if centered {
          origin = CGPoint(x: -triangleInRect.width / 2, y: -triangleInRect.height / 2)
      }
      moveToPoint(origin)
      addLineToPoint(CGPoint(x: origin.x + triangleInRect.width, y: origin.y))
      addLineToPoint(CGPoint(x: origin.x + triangleInRect.width / 2, y: origin.y + triangleInRect.height))
      closePath()
  }
  </code></pre>