title: animate rotation UIImageView in swift
body: <p>I'm trying to animate a rotation of 180 degrees of a <code>UIImageView</code> in Swift </p>
  
  <pre><code>    UIView.animateWithDuration(1.0, animations: { () -&gt; Void in
          self.arrowImageView.transform = CGAffineTransformMakeRotation(CGFloat(180 * M_PI))
      }) { (succeed) -&gt; Void in
  
      }
  </code></pre>
  
  <p>But isnt animating at all.
  I want to use animateWithDuration cause i want to make it back at some point using <code>CGAffineTransformMakeIdentity</code></p>
  
  <p>Using <code>UIView</code> animations works.</p>
  
  <pre><code>    UIView.beginAnimations(nil, context: nil)
      UIView.setAnimationDuration(1)
      UIView.setAnimationCurve(UIViewAnimationCurve.EaseIn)
      let radians = CGFloat(180 * M_PI / 180)
      arrowImageView.transform = CGAffineTransformMakeRotation(radians)
      UIView.commitAnimations()
  </code></pre>