title: Disable vertical scroll in UIScrollView Swift
body: <p>(Don't mark this question as duplicated. I read a lot of questions but I don't find the answer to my issue.)</p>
  
  <p>My issue is the following: I have a <code>UIScrollView</code> which is supposed to only scroll horizontally. Here it scrolls vertically for 20px (strange fact: it appears to be the same height of the status bar). </p>
  
  <p>I tried to print the content size, the y offset and the height of the <code>UIScrollView</code> like this: </p>
  
  <pre><code>print(horizontalScrollView.contentSize)
  print(horizontalScrollView.bounds.size.height)
  print(horizontalScrollView.contentOffset.y)
  </code></pre>
  
  <p>I get this: </p>
  
  <pre><code>(1125.0, 667.0). // scrollview content size
  667.0.           // scrollview height
  -20.0            // content offset (y)
  </code></pre>
  
  <p>I know that the <code>scrollView</code> content size height must be &lt;= <code>scrollView</code> height. And as you can see this is the case.</p>
  
  <p>I use constraints to put 3 <code>UIViewController</code> stacked horizontally. And it works well except of this issue.</p>
  
  <p>Another fact: It worked before Swift 4 and Xcode 9... I don't know if this could be the cause or not.</p>
  
  <p>Do you have some ideas? Thanks in advance for your help. </p>