title: rotate image 90 degrees around anchor point
body: <p>I want to rotate my imageview 90 degrees around an anchor point. You can see what I want to achieve over here.<img src="https://i.stack.imgur.com/elRyD.jpg" alt="enter image description here"></p>
  
  <p>I've got this piece of code.</p>
  
  <pre><code>CGFloat DegreesToRadians(CGFloat degrees)
  {
      return degrees * M_PI / 180;
  }
  
  NSNumber* DegreesToNumber(CGFloat degrees)
  {
      return [NSNumber numberWithFloat:
              DegreesToRadians(degrees)];
  }
  -(IBAction)rotate:(id)sender{
      CABasicAnimation *rotationAnimation = [CABasicAnimation
                                             animationWithKeyPath:@"transform.rotation.y"];
  
      [rotationAnimation setFromValue:DegreesToNumber(0)];
      [rotationAnimation setToValue:DegreesToNumber(90)];
      [rotationAnimation setDuration:3.0f];
      [rotationAnimation setRepeatCount:1];
  
      [[[self imgShare] layer] addAnimation:rotationAnimation forKey:@"rotate"];
  }
  </code></pre>
  
  <p>There are a view problems. First when it rotates 90 degrees it immedialty flips back to its original state. Also I don't know how I can turn it arround an anchor point.</p>
  
  <p>Any help ?</p>