title: Rotate image on center using one finger touch
body: <p>I want to rotate the below image on a center point using one finger touch...</p>
  
  <p>And i want to display the value of the image with the label when I rotate the image using touch.</p>
  
  <p>I have done the image rotation but the problem is that how to set the value of the image according to rotation.</p>
  
  <p>The angle of the rotation is increase so i can not set the value.</p>
  
  <p>Can any one help me?</p>
  
  <p>The code is below</p>
  
  <pre><code>float fromAngle = atan2(firstLoc.y-imageView.center.y, 
                              firstLoc.x-imageView.center.x);
  
      NSLog(@"From angle:%f",fromAngle);
      float toAngle = atan2( currentLoc.y-imageView.center.y, 
                            currentLoc.x-imageView.center.x);
  
      NSLog(@"to Angle:%f",toAngle);
      // So the angle to rotate to is relative to our current angle and the
      // angle through which our finger moved (to-from)
      float newAngle =angle+(toAngle-fromAngle);
  
  
      NSLog(@"new angle:%.2f",newAngle);
  
  
   CGAffineTransform cgaRotate = CGAffineTransformMakeRotation(newAngle);
  
   imageView.transform=cgaRotate;
  
  
  angle = newAngle;
  </code></pre>
  
  <p>Can any one help me ?</p>