title: UIPinchGestureRecognizer for zooming and panning an image in xcode
body: <p>I have created one application in which there is one view containing an image view.
  Below code for zooming an image using UIPinchGestureRecognizer is working.
  Here innerview is the name of my view.</p>
  
  <pre><code> - (void)viewDidLoad
      {
  [super viewDidLoad];
  
  //Zoom Photo
  UIPinchGestureRecognizer *pinchGesture = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(handlePinch:)];
  [innerview addGestureRecognizer:pinchGesture];
  [pinchGesture release];
  mCurrentScale = 0;
  mLastScale = 0;
  }
  
  -(void)handlePinch:(UIPinchGestureRecognizer*)sender {
  
  NSLog(@"latscale = %f",mLastScale);
  
  mCurrentScale += [sender scale] - mLastScale;
  mLastScale = [sender scale];
  
  if (sender.state == UIGestureRecognizerStateEnded)
  {
      mLastScale = 1.0;
  }
  
  CGAffineTransform currentTransform = CGAffineTransformIdentity;
  CGAffineTransform newTransform = CGAffineTransformScale(currentTransform,mCurrentScale, mCurrentScale);
  innerview.transform = newTransform;
  
   } 
  </code></pre>
  
  <p>But how to use ScrollView in this to view image properly??</p>