title: I need to make my UIImageView fit inside my UIScrollView without panning. [iOS]
body: <p>I have an image inside of an iOS UIScrollView that only takes up about 1/3rd of the total screen space. The image is too large, so the scrollView is allowing panning around the image. I want the image to be small enough so that there is no panning necessary to see the entire image. How do I resize the image to make it fit inside of the scroll view?</p>
  
  <p>This is the code I am using to set up the image view and the scroll view.</p>
  
  <pre><code>UIImage *image = [UIImage imageNamed:@"banner.png"];
  self.imageView = [[UIImageView alloc] initWithImage:image];
  self.imageView.frame = (CGRect){.origin=CGPointMake(0.0f, 0.0f), .size=image.size};
  [self.scrollView addSubview:self.imageView];
  
  self.scrollView.contentSize = image.size;
  </code></pre>