title: ScrollView with StackView Inside Programmatically Not Scrolling
body: <p>I am making a <code>UIScrollView</code> with a <code>UIStackView</code> inside it programmatically.</p>
  
  <p>The <code>UIScrollView</code> does not scroll even though the <code>UIStacVview</code> that is inside it has a much larger width.</p>
  
  <p><strong>Here is my code:</strong></p>
  
  <pre><code>    view.backgroundColor = UIColor(red: 0.161, green: 0.165, blue: 0.188, alpha: 1.00) // 292a30
  
      view1.backgroundColor = UIColor.green
      view2.backgroundColor = UIColor.yellow
      view3.backgroundColor = UIColor.gray
      view4.backgroundColor = UIColor.white
      view5.backgroundColor = UIColor.orange
  
      scrollView.backgroundColor = UIColor.red
      scrollView.frame = CGRect(x: 10, y: 100, width: view.frame.width - 20, height: 100)
      scrollView.translatesAutoresizingMaskIntoConstraints = false
  
      stackView.backgroundColor = UIColor.blue
      stackView.axis = .horizontal
      stackView.spacing = 10
      stackView.distribution = .fillEqually
      stackView.frame = CGRect(x: 0, y: 0, width: view.frame.width + 200, height: 100)
      stackView.addArrangedSubview(view1)
      stackView.addArrangedSubview(view2)
      stackView.addArrangedSubview(view3)
      stackView.addArrangedSubview(view4)
      stackView.addArrangedSubview(view5)
  
      scrollView.addSubview(stackView)
      view.addSubview(scrollView)
  </code></pre>
  
  <p><strong>What is working:</strong></p>
  
  <ol>
  <li>The <code>UIStackView</code> loads and looks like this:</li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/aXsXr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aXsXr.png" alt=""></a></p>
  
  <ol start="2">
  <li>The <code>UIStackView</code> stretches out the side of the <code>UIScrollView</code>.</li>
  </ol>
  
  <p><strong>What is not working:</strong></p>
  
  <ol>
  <li>You cannot scroll with the <code>UIScrollView</code>, it is just like it isn't there.</li>
  </ol>