title: Animating UIView shape and its content
body: <p>In an iPhone app how would you animate the shape of an <code>UIView</code>, for example changing from a rectangle into a circle?</p>
  
  <p>I've tried with:</p>
  
  <pre><code>CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"path"];
  animation.duration = 20.0;
  animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
  animation.fromValue = (__bridge_transfer id)aPath;
  animation.toValue = (__bridge_transfer id)anotherPath;
  [myShapeLayer addAnimation:animation forKey:@"animatePath"];
  </code></pre>
  
  <p>where <code>myShapeLayer</code> is an instance of <code>CAShapeLayer</code> and <code>aPath</code> and <code>anotherPath</code> <code>CGMutablePathRef</code>.
  It works but the view content is not animated as well.</p>
  
  <p>I need to transform a view into a circle and then let it shrink until it disappears.</p>