title: Smoothly speed up an running rotation animation
body: <p>I use this code to rotate any view:</p>
  
  <pre><code>func rotateAnimation(theView: UIView, duration: CFTimeInterval = 20.0, repeatCount: Float = 200, toValue: CGFloat = CGFloat(.pi * 2.0)) {
      let rotateAnimation = CABasicAnimation(keyPath: "transform.rotation")
      rotateAnimation.fromValue = 0.0
      rotateAnimation.toValue = toValue
      rotateAnimation.duration = duration
      rotateAnimation.repeatCount = repeatCount
      theView.layer.add(rotateAnimation, forKey: nil)
  }
  </code></pre>
  
  <p>I would like to know how to speed up that currently running animation. If for example an UIView is rotating with the code above, how can I make that speed go twice as fast with a nice transation?</p>
  
  <p>So: <em>calls rotateAnimation</em>: rotating at normal speed -> <em>calls ?function?</em> -> UIView will smoothly go spinning faster to desired speed -> UIView will keep spinning at desired speed.</p>
  
  <p>Thanks for any help.</p>