title: How to animate drawing in Swift, but also change a UIImageView's scale?
body: <p>I'd like to animate a drawing sequence.  My code draws a spiral into a UIImageView.image.  The sequence changes the image contents, but also changes the <strong>scale</strong> of the surrounding UIImageView.  The code is parameterized for the number of revolutions of the spiral:</p>
  
  <pre><code>func drawSpiral(rotations:Double) {
  let scale = scaleFactor(rotations)   // do some math to figure the best scale
  
  UIGraphicsBeginImageContextWithOptions(mainImageView.bounds.size, false, 0.0)
  let context = UIGraphicsGetCurrentContext()!
  context.scaleBy(x: scale, y: scale)      // some animation prohibits changes!
  // ...  drawing happens here
  myUIImageView.image = UIGraphicsGetImageFromCurrentImageContext()
  }
  </code></pre>
  
  <p>For example, I'd like to animate from <code>drawSpiral(2.0)</code> to <code>drawSpiral(2.75)</code> in 20 increments, over a duration of 1.0 seconds.</p>
  
  <p>Can I setup <code>UIView.annimate(withDuration...)</code> to call my method with successive intermediate values? How? Is there a better animation approach?</p>