title: iOS layer animation - explanation
body: <pre><code>let flyRight = CABasicAnimation(keyPath: "position.x")
  flyRight.toValue = view.bounds.size.width/2
  flyRight.duration = 0.5
  flyRight.fromValue = -view.bounds.size.width/2
  flyRight.fillMode = kCAFillModeBoth
  flyRight.beginTime = CACurrentMediaTime() + 3.4
  password.layer.position.x = view.bounds.size.width/2
  password.layer.addAnimation(flyRight, forKey: nil)
  </code></pre>
  
  <p>My question is: how is it possible that before I am adding the animation, I first put the layer at the end position, but when the app goes up, I don't see it there before the animation starts? Instead, the animation works after 3.4 seconds as expected.</p>
  
  <p>I mean, how iOS knows that first it needs to run the animation and only then put the layer to it's final position? </p>