title: CABasicAnimation swift not working
body: <p>I'm newly moving from obj C to swift, i'm not sure why it's not working because in obj c it's working fine, please take a look to my code</p>
  
  <p>Here is my code </p>
  
  <pre><code>func addAnimationOnLayer( layer: CALayer, position: CGPoint, duration: TimeInterval, delay: TimeInterval, fromPosition: CGPoint, toPostion: CGPoint, key: String) {
          layer.setAffineTransform(CGAffineTransform(translationX: position.x, y: position.y))
          CATransaction.begin()
          CATransaction.setCompletionBlock {
              layer.setAffineTransform(CGAffineTransform(translationX: 0, y: 0))
          }
          let theAnimation = CABasicAnimation(keyPath: "transform.translation")
          theAnimation.isRemovedOnCompletion = false
          theAnimation.timingFunction = CAMediaTimingFunction(name:kCAMediaTimingFunctionEaseInEaseOut)
          theAnimation.fillMode = kCAFillModeForwards
          theAnimation.duration = duration
          theAnimation.beginTime = delay
          theAnimation.fromValue = fromPosition
          theAnimation.toValue = toPostion
  
          layer.add(theAnimation, forKey: key)
          CATransaction.commit()
      }
  </code></pre>
  
  <p>and i call the function with this</p>
  
  <pre><code>self.addAnimationOnLayer(layer: self.logoImage.layer, position: CGPoint(x: 0, y:100), duration: 0.8, delay: 0.1, fromPosition: CGPoint(x: 0,y: 100), toPostion: CGPoint(x: 0,y: 0), key: "logoStartAnimation")
  </code></pre>