title: Double-tapping to zoom on UIImageView
body: <p>I'm looking at Apple's example code from the ScrollViewSuite. I must be doing something wrong in comparison.  In their RootViewController, they do:</p>
  
  <pre><code>- (void)loadView {
      [super loadView];
  
      // set the tag for the image view
      [imageView setTag:ZOOM_VIEW_TAG];
  
      // add gesture recognizers to the image view
      UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap:)];
      UITapGestureRecognizer *doubleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleDoubleTap:)];
      UITapGestureRecognizer *twoFingerTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTwoFingerTap:)];
  
      [doubleTap setNumberOfTapsRequired:2];
      [twoFingerTap setNumberOfTouchesRequired:2];
  
      [imageView addGestureRecognizer:singleTap];
      [imageView addGestureRecognizer:doubleTap];
      [imageView addGestureRecognizer:twoFingerTap];
  
      [singleTap release];
      [doubleTap release];
      [twoFingerTap release];
  
      // calculate minimum scale to perfectly fit image width, and begin at that scale
      float minimumScale = [imageScrollView frame].size.width  / [imageView frame].size.width;
      [imageScrollView setMinimumZoomScale:minimumScale];
      [imageScrollView setZoomScale:minimumScale];
  }
  </code></pre>
  
  <p>In IB, they have their imageView as a subView of the imageScrollView.  My .xib is set up the same way.  I put this code in my viewDidLoad instead of loadView.  I do not get any calls when I double tap on my imageView.  I'm wondering why.  Here is my version of what they did:</p>
  
  <pre><code>- (void)viewDidLoad {
      [self updateOnScreenImages];  // this is where my imageView.image property gets set
  
      UITapGestureRecognizer *doubleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleDoubleTap:)];
      doubleTap.numberOfTapsRequired = 2;
  
      UITapGestureRecognizer *twoFingerTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTwoFingerTap:)];
      [doubleTap setNumberOfTouchesRequired:2];
  
  
      [self.imageView addGestureRecognizer:doubleTap];
      [self.imageView addGestureRecognizer:twoFingerTap];
  
      [doubleTap release];
      [twoFingerTap release];
  
  }
  </code></pre>
  
  <p>Is there something I am doing wrong compared to what Apple is doing?  The logic seems pretty similar to me.  But I'm not getting my callbacks when I double tap.  I tried adding the gestures to the self.scrollView as well, but that doesn't work either.  Thoughts?  Thanks!</p>