title: iPhone4 iOS5 UIRotationGestureRecognizer, how to remember rotation offset for subsequent rotations?
body: <p>I'm trying to create a knob-like behavior in one of my views with a <code>UIRotationGestureRecognizer</code>. This works, and positions the view as expected. However, every single time a gesture is performed, the rotation of the recognizer resets, so the knob starts at 0 every time. </p>
  
  <p><strong>How can I remember the last rotation of the UIRotationGestureRecognizer to let the user adjust the knob UIView without resetting it every single time?</strong></p>
  
  <p><strong>I'm trying to make the recognizer start calculating rotation changes from the view's last known rotation:</strong></p>
  
  <pre><code>knob starts at 0, recognizer is at 0
  recognizer is rotated to 45 degrees
  recognizer stops rotating
  the knob is left at 45 degrees //this is already happening with the provided code snippet
  </code></pre>
  
  <p>next touch:</p>
  
  <pre><code>//this is what's is happening
  recognizer starts at 0, rotates the knob back to 0
  //I want it to be:
  recognizer starts at 45, rotates the knob as in the example above. 
  
  
  - (IBAction)rotateView:(id)sender {
  
      if([sender isKindOfClass:[UIRotationGestureRecognizer class]])
      {
              UIRotationGestureRecognizer* recognizer = sender;
  
              CGAffineTransform transform = CGAffineTransformMakeRotation([recognizer rotation]);
              rotatingView.transform = transform;
      }
  
  }
  </code></pre>