title: Programmatically zooming into small area of larger picture using UIScrollView
body: <p>I'm trying to get my code to programmatically zoom into a small area of the larger picture.  I'll add the tap code later, but right now I just want to see it work.</p>
  
  <p>The zoomToRect in this code does absolutely nothing and I simply don't understand why.  When I build it, the image just sits there at the 0,0 origin.</p>
  
  <p>I've tried using:</p>
  
  <p>setContentOffset and scrollRectToVisible and both these work fine -the image moves to the specified coordinates.  But neither of these is what I want, because I need to move and zoom the image, not just move it.</p>
  
  <p>But zoomToRect utterly refuses to do anything.  I've read about 50 pages of examples and tutorials on this now and not a damn thing works.  I'm tearing my hair out not knowing why.  Clearly I'm missing some really fundamental or important point.</p>
  
  <pre><code>UIImage *myFirstImage = [UIImage imageNamed:@"manga_page.jpg"];
  
  UIImageView *myFirstImageView = [[UIImageView alloc] initWithImage:myFirstImage];
  
  [myFirstImageView setFrame:CGRectMake(0, 0, myFirstImage.size.width, myFirstImage.size.height)];
  
  
  UIScrollView *myFirstScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
  
  [myFirstScrollView setContentSize:CGSizeMake(myFirstImage.size.width, myFirstImage.size.height)];
  
  [myFirstScrollView addSubview:myFirstImageView];
  
  [self.view addSubview:myFirstScrollView];
  
  [myFirstScrollView zoomToRect:CGRectMake(300, 300, 300, 300) animated:YES];
  </code></pre>