title: animating strokeEnd in a CAShapeLayer using an animation block in Swift
body: <p>I am attempting to trace out the shape of a path that I've place into a CAShapeLayer.  In this function, the points in the points array represent the vertices of a regular polygon.  The animation isn't happening, though.  It's just appearing, totally animated.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>private func drawShape (point: [(x: Double, y:Double)]) {
  
      let shapeLayer = CAShapeLayer()
  
      let shapePath = UIBezierPath()
      shapePath.moveToPoint(CGPoint(x:point[point.count-1].x, y:point[point.count-1].y))
  
      for i in point {
          shapePath.addLineToPoint(CGPoint(x:i.x, y:i.y))
      }
  
      shapeLayer.path = shapePath.CGPath
  
      drawingSurface.layer.addSublayer(shapeLayer)
  
      shapeLayer.fillColor = UIColor.clearColor().CGColor
      shapeLayer.strokeColor = UIColor.blackColor().CGColor
      shapeLayer.strokeEnd = 0
  
      UIView.animateWithDuration(30, delay: 0, options: .CurveEaseInOut, animations: {
          shapeLayer.strokeEnd = 1
          }, completion: {finished in println("This Finished")
      })
  }
  </code></pre>
  
  <p>What I expect is that it will draw the stroke over the duration that I have set (30 seconds at the moment), but instead, it just appears, fully drawn with no animation.</p>
  
  <p>Any thoughts?</p>