title: Get the height of the UIScrollView after layout in Swift
body: <p>I have a situation where I'm using a UIScrollView to help users with smaller phones see the full text inside a window. And I was wanting to show an image icon if they needed to scroll (just so that they know there is more inside the window) but I'm having a problem finding the height of the scrollview using Swift.</p>
  
  <p>This is the hierarchy of my objects</p>
  
  <p><a href="https://i.stack.imgur.com/UkDzI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UkDzI.png" alt="enter image description here"></a></p>
  
  <p>Basically, those 4 labels fit inside a 4.7" iPhone but not the 4" iPhone. I tried setting some logic to check if the UIScrollView content is larger than the window, but it doesn't seem to be working. I keep getting that the height is zero.</p>
  
  <p>I'm using <code>scrollHeight = scrollView.contentSize.height</code> and have tried putting that inside of <code>viewDidLoad()</code>, <code>viewWillAppear()</code>, and <code>viewDidLayoutSubviews()</code> but every time it ends up being 0.</p>
  
  <p>Is <code>contentSize</code> the right thing I should be using to check the height?</p>