title: iOS: Simultaneous scale and 3D rotation animation
body: <p>I made a video demonstrating the animation i'm trying to accomplish: <a href="http://cl.ly/LmSM">Here it is.</a></p>
  
  <p>Notice the video illustrates the action as it would be seen from the side. The camera icon represents the user's POV. It's basically a simulation of a translation among the Z-axis accomplished though a scale transform, with a simultaneous independent two-step 3D rotation happening along the X axis.</p>
  
  <p>Looks and sounds simple enough, right? Wrong. Here's the ideal code, which doesn't work:</p>
  
  <pre><code>[UIView animateWithDuration:0.4 delay:0.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
      view.transform = CGAffineTransformMakeScale(1.0, 1.0);
  } completion:^(BOOL finished) {}];
  
  [UIView animateWithDuration:0.2 delay:0.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
      CATransform3D rotation = CATransform3DIdentity;
      rotation.m34 = 1.0 / - 1800;
      rotation = CATransform3DRotate(rotation, - 20 * M_PI / 180.0f, 1, 0, 0);
  
      view.layer.transform = rotation;
  
  } completion:^(BOOL finished) {
      [UIView animateWithDuration:0.2 delay:0.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
          view.layer.transform = CATransform3DIdentity;
  
      } completion:^(BOOL finished) {}];
  }];
  </code></pre>
  
  <p>Turns out, if you do this, the 3D rotation gets ignored completely. I've tried a number of other approaches, and they all have failed.</p>
  
  <h3>Some requirements:</h3>
  
  <ul>
  <li>Scale should preferably be a <code>CGAffineTransform</code></li>
  <li>Easings should be as illustrated, especially on the rotation</li>
  </ul>
  
  <p>Of course, if a solution comes up that requires some of these to change, I could adapt.</p>
  
  <p>Thanks in advance for any help. If you need clarification, please do ask.</p>