title: CAShapeLayer slowing down interface rotation
body: <p>I am trying to move some custom drawing code from a view into a <code>CAShapeLayer</code>, which then get added as a sublayer to the original view's <code>CALayer</code>. This also works well, but when rotating the device, the animation starts to stutter, e.g. you just see the frame in the original orientation and then the final orientation, with at most one frame in between - not smooth at all. Slide-in and slide-out animations of the corresponding <code>UIViewController</code> are a bit jerky, too (but not that much).</p>
  
  <p>All the <code>CAShapeLayer</code> has in its <code>path</code> is one <code>CGPathAddRect</code>, it is set to be <code>opaque</code>, its <code>opacity</code> is <code>1.0f</code> and the <code>fillColor</code> is set to opaque blue.</p>
  
  <p>When drawing the path directly in the views <code>drawRect</code> method, however, the animation <em>is</em> smooth. So I suppose it has something to do with the <code>CAShapeLayer</code> being animated during the rotation.</p>
  
  <p>Could you tell me how to either get rid of those jerkiness or just hide the <code>CAShapeLayer</code> when animating? Getting back to just draw <code>CGPath</code>s directly is not an option to me because I rely on the ability of <code>CAShapeLayer</code> to animate its path (it is not animated in my tries with rotating the view).</p>
  
  <p>/update: this also happens when the rotating <code>UIViewController</code>s view contains a view with a subclass of <code>CAGradientLayer</code> as its <code>layerClass</code> (e.g. a view with a gradient layer as background).</p>
  
  <p>Cheers</p>
  
  <p>MrMage</p>