title: Rotate UIImageView around its center point?
body: <p>I have a transparent png inside a UIImageView (<code>self.myImage</code>) that I want to rotate around its center point. 
  The code should be pretty simple:</p>
  
  <pre><code>[self.myImage.layer setAnchorPoint:CGPointMake(0.5, 0.5)];
  [UIView animateWithDuration:1.0 animations:^{
      [self.myImage setTransform:CGAffineTransformMakeRotation(angle)];
  }];
  </code></pre>
  
  <p>The image rotates at the right speed/time and at the right angle, but its position gets shifted.  Here's an example of what's happening:</p>
  
  <p><img src="https://i.stack.imgur.com/xIM8A.png" alt="enter image description here"></p>
  
  <p>The gray square is just to show position in the screen. The transparent png (contained in a UIImageView) is the other figure. The white dotted lines show the center of the UIImageView.  The left side of the image shows the original position of the image, the right side shows the image after being rotated with the above code (which gets shifted a little down to the right). The black and white circles are in the center of the image file.  </p>
  
  <p>Is there something that I'm missing? As far as I understand, the first line above is not required because those are the defaults. Do I have to set/unset something in the storyboard/programmatically?</p>