title: Pinch To Zoom Effect on UIImageView inside scrollView?
body: <p>I'm using storyboard (iOS 6.0) to create a photo gallery viewer for my app. This is how my imageViewController is set up in storyboard:</p>
  
  <p><img src="https://i.stack.imgur.com/CvaGs.png" alt="enter image description here"></p>
  
  <p>I've made sure to enable userInteraction and multiple touches on both the imageView and scrollView. What I want to do is, on pinch I want to zoom into the imageView (maximum scale 3) and be able to pan around. This is what I currently have, however, even though the pinch gesture is detected the scale does not change.</p>
  
  <pre><code>- (IBAction)imagePinched:(id)sender {
  
  if (pinchRecognizer.state == UIGestureRecognizerStateEnded || pinchRecognizer.state == UIGestureRecognizerStateChanged) {
  
      NSLog(@"gesture.scale = %f", pinchRecognizer.scale);
  
      CGFloat currentScale = self.fullScreenView.frame.size.width / self.fullScreenView.bounds.size.width;
      CGFloat newScale = currentScale * pinchRecognizer.scale;
  
      if (newScale &lt; 1) {
          newScale = 1;
      }
      if (newScale &gt; 3) {
          newScale = 3;
      }
  
      CGAffineTransform transform = CGAffineTransformMakeScale(newScale, newScale);
          self.fullScreenView.transform = transform;
          pinchRecognizer.scale = 1;
      }
  
  }
  </code></pre>
  
  <p>Most questions and tutorials online deal with programmatically creating the views and doing this, but the less code the better (in my eyes). What's the best way to get this to work with storyboard? Thank you in advance!!!</p>
  
  <hr>
  
  <p><strong>UPDATED:</strong></p>
  
  <p>Here is my full .m file code:</p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
  
      //Assign an image to this controller's imageView
      fullScreenView.image = [UIImage imageNamed:imageString];
  
      //Allows single and double tap to work
      [singleTapRecognizer requireGestureRecognizerToFail: doubleTapRecognizer];
  }
  
  - (IBAction)imageTapped:(id)sender {
  
      NSLog(@"Image Tapped.");
  
      //On tap, fade out viewController like the twitter.app
      [self dismissViewControllerAnimated:YES completion:nil];
  }
  
  - (IBAction)imageDoubleTapped:(id)sender {
  
      NSLog(@"Image Double Tapped.");
  
      //On double tap zoom into imageView to fill in the screen.
      [fullScreenView setContentMode:UIViewContentModeScaleAspectFill];
  }
  
  - (IBAction)imagePinched:(id)sender {
  
      if (pinchRecognizer.state == UIGestureRecognizerStateEnded || pinchRecognizer.state == UIGestureRecognizerStateChanged) {
  
          NSLog(@"gesture.scale = %f", pinchRecognizer.scale);
  
          CGFloat currentScale = self.fullScreenView.frame.size.width / self.fullScreenView.bounds.size.width;
          CGFloat newScale = currentScale * pinchRecognizer.scale;
  
          if (newScale &lt; 1) {
              newScale = 1;
          }
          if (newScale &gt; 3) {
              newScale = 3;
          }
  
          CGAffineTransform transform = CGAffineTransformMakeScale(newScale, newScale);
          self.fullScreenView.transform = transform;
          pinchRecognizer.scale = 1;
      }
  }
  
  - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
  {
      return self.fullScreenView;
  }
  
  
  -(void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale {
  
  }
  
  - (void)didReceiveMemoryWarning
  {
      [super didReceiveMemoryWarning];
      // Dispose of any resources that can be recreated.
  }
  
  @end
  </code></pre>