title: Problem scaling UIImageView with Pinch Gesture
body: <p>I have a program that creates a small UIImageView that responds to touch so you can drag it around the superview.</p>
  
  <p>I added a UIPinchGestureRecognizer in order to Scale the image up and down. With the current code, the image scales up and down perfectly but restarts at scale 1.0 when a new pinch gesture starts.</p>
  
  <p>I tried using contentScaleFactor to get the initial ImageView scale but it's always 1.0, so clearly the below code won't work properly.</p>
  
  <pre><code>- (void)doPinch:(UIPinchGestureRecognizer *)pinch {
  
  
  
  if (pinch.state == UIGestureRecognizerStateBegan) {
  
      initialScale = dragImage.contentScaleFactor;        
  
      } else {
  
      CGFloat newScale = initialScale * pinch.scale;
  
      CGAffineTransform transform = CGAffineTransformMakeScale(newScale,newScale);
  
      dragImage.transform = transform;
  
      }
  
  
  }
  </code></pre>
  
  <p>This code was adapted from the "Pinch me" example in the Apress Beginning iPhone 4 Development book.</p>
  
  <p>Since contentScaleFactor doesn't work, do I need to use a core graphics property? Does CGAffineTransformScale have something to do with it?</p>
  
  <p>Thanks!</p>