title: Can't scroll UIImageView with AspectFill in UIScrollView and AutoLayout
body: <p>I have a UIScrollView with a single UIImageView child. The scrollView is pinned on all sides to the (root) parent container with autolayout, and the child imageview is also pinned to all sides with content mode set to <code>AspectFill</code>.</p>
  
  <pre><code>UIImage *image = [UIImage imageNamed:@"photo1.jpeg"];
  
  _imageView.image = image;
  _imageView.contentMode = UIViewContentModeScaleAspectFill;
  
  _scrollView.contentOffset = CGPointZero;
  _scrollView.contentSize = _imageView.image.size;
  _scrollView.zoomScale = 1;
  </code></pre>
  
  <p>The image in this case is wider than my screen. When I launch my app, the imageview is correctly displaying the image filling up the screen. However, I can't seem to pan the image left or right. When i zoom in, I can pan, however, I'm unable to pan to the corners of the image.</p>
  
  <p>I feel like my content size is not being computed properly thanks to auto-layout, but I'm not sure which parameters I can play which would allow me to scroll the image to its edges.</p>
  
  <p>I've attached an image below, where you can see that the image can't be scrolled in a way that displays the beginning of 'happiness'. I also uploaded the sample <a href="https://github.com/vijaysharm/stackoverflow-31296497" rel="nofollow noreferrer">here</a></p>
  
  <p><img src="https://i.stack.imgur.com/8mwDS.gif" alt="autolayout"></p>