title: Layer Position jumps at start of (Core) Animation
body: <p>So, I'm trying to create a tile flipping effect, like on Windows Phone 7.</p>
  
  <p>So far I have the following code, but I have a couple of queries.</p>
  
  <pre><code>CALayer *layer = self.theRedSquare.layer;
  CATransform3D initialTransform = self.theRedSquare.layer.transform;
  initialTransform.m34 = 1.0 / -1000;
  
  [UIView beginAnimations:@"Scale" context:nil];
  [UIView setAnimationDuration:1];
  [UIView setAnimationCurve: UIViewAnimationCurveEaseInOut];
  layer.transform = initialTransform;
  layer.anchorPoint = CGPointMake(-0.3, 0.5);
  
  CATransform3D rotationAndPerspectiveTransform = self.theRedSquare.layer.transform;
  
  rotationAndPerspectiveTransform = CATransform3DRotate(rotationAndPerspectiveTransform, M_PI , 0 , -self.theRedSquare.bounds.size.height/2, 0);
  
  layer.transform = rotationAndPerspectiveTransform;
  
  [UIView setAnimationDelegate:self];
  [UIView commitAnimations];
  </code></pre>
  
  <p><strong>1. How come my my red square (a simple UI view) translates to the right at the start of the animation?</strong></p>
  
  <p><strong>2. For the anchor point is it possible to set a position on the parent view? At the moment I am arbitrarily setting it relative to the current view.</strong></p>
  
  <p>Thanks in advance for any pointers.</p>
  
  <p><em>Before animation</em></p>
  
  <p><img src="https://i.stack.imgur.com/63yPy.png" alt="Before"></p>
  
  <p><em>During animation (notice the square has shifted right)</em></p>
  
  <p><img src="https://i.stack.imgur.com/qfAiW.png" alt="During"></p>
  
  <p><em>After animation (notice the square has shifted right)</em></p>
  
  <p><img src="https://i.stack.imgur.com/xJqqY.png" alt="After"></p>
  
  <p>Video added: <a href="http://www.youtube.com/watch?v=q8i0Bdmluh4&amp;feature=youtu.be" rel="noreferrer">example video</a></p>