title: Why doesn't my vertical programmatic scroll view work in Swift
body: <p>I have created a test project to see if I can get a swift programmatic scroll view to work and I just cannot get the test data to scroll. Here is my test code.</p>
  <pre><code>import UIKit
  
  class ViewController: UIViewController {
  
      private let viewLabel0: UILabel = {
          let label = UILabel()
          label.text = &quot;Stephen 0&quot;
          label.font = UIFont.systemFont(ofSize: 30)
          label.textColor = .white
          return label
      }()
      
  
      private let viewLabel1: UILabel = {
          let label = UILabel()
          label.text = &quot;Stephen 1&quot;
          label.font = UIFont.systemFont(ofSize: 30)
          label.textColor = .white
          return label
      }()
  
      private let viewLabel2: UILabel = {
          let label = UILabel()
          label.text = &quot;Stephen 2&quot;
          label.font = UIFont.systemFont(ofSize: 30)
          label.textColor = .white
          return label
      }()
  
      private let viewLabel3: UILabel = {
          let label = UILabel()
          label.text = &quot;Stephen 3&quot;
          label.font = UIFont.systemFont(ofSize: 30)
          label.textColor = .white
          return label
      }()
  
      private let viewLabel4: UILabel = {
          let label = UILabel()
          label.text = &quot;Stephen 4&quot;
          label.font = UIFont.systemFont(ofSize: 30)
          label.textColor = .white
          return label
      }()
      
      private let viewLabel5: UILabel = {
          let label = UILabel()
          label.text = &quot;Stephen 5&quot;
          label.font = UIFont.systemFont(ofSize: 30)
          label.textColor = .white
          return label
      }()
  
      private let viewLabel6: UILabel = {
          let label = UILabel()
          label.text = &quot;Stephen 6&quot;
          label.font = UIFont.systemFont(ofSize: 30)
          label.textColor = .white
          return label
      }()
      
  
      private let viewLabel7: UILabel = {
          let label = UILabel()
          label.text = &quot;Stephen 7&quot;
          label.font = UIFont.systemFont(ofSize: 30)
          label.textColor = .white
          return label
      }()
  
      private let viewLabel8: UILabel = {
          let label = UILabel()
          label.text = &quot;Stephen 8&quot;
          label.font = UIFont.systemFont(ofSize: 30)
          label.textColor = .white
          return label
      }()
  
      private let viewLabel9: UILabel = {
          let label = UILabel()
          label.text = &quot;Stephen 9&quot;
          label.font = UIFont.systemFont(ofSize: 30)
          label.textColor = .white
          return label
      }()
  
      private let viewLabel10: UILabel = {
          let label = UILabel()
          label.text = &quot;Stephen 10&quot;
          label.font = UIFont.systemFont(ofSize: 30)
          label.textColor = .white
          return label
      }()
      
      private let viewLabel11: UILabel = {
          let label = UILabel()
          label.text = &quot;Stephen 11&quot;
          label.font = UIFont.systemFont(ofSize: 30)
          label.textColor = .white
          return label
      }()
  
      private let viewLabel12: UILabel = {
          let label = UILabel()
          label.text = &quot;Stephen 12&quot;
          label.font = UIFont.systemFont(ofSize: 30)
          label.textColor = .white
          return label
      }()
  
      private let viewLabel13: UILabel = {
          let label = UILabel()
          label.text = &quot;Stephen 13&quot;
          label.font = UIFont.systemFont(ofSize: 30)
          label.textColor = .white
          return label
      }()
      
      private let viewLabel14: UILabel = {
          let label = UILabel()
          label.text = &quot;Stephen 14&quot;
          label.font = UIFont.systemFont(ofSize: 30)
          label.textColor = .white
          return label
      }()
      
      private lazy var scrollView: UIScrollView = {
          let sv = UIScrollView()
          sv.isScrollEnabled = true
          sv.contentSize = CGSize(width: self.view.frame.width, height: self.view.frame.height * 3.0)
          return sv
      }()
      
      private let contentView: UIView = {
          let cv = UIView()
          return cv
      }()
      
      override func viewDidLoad() {
          super.viewDidLoad()
          
          view.backgroundColor = UIColor.mainBackgroundColor
          
          view.addSubview(scrollView)
          scrollView.anchor(top: view.topAnchor,
                            left: view.leftAnchor,
                            bottom: view.bottomAnchor,
                            right: view.rightAnchor)
          
          scrollView.addSubview(contentView)
          contentView.anchor(top: scrollView.contentLayoutGuide.topAnchor,
                             left: scrollView.frameLayoutGuide.leftAnchor,
                             bottom: scrollView.contentLayoutGuide.bottomAnchor,
                             right: scrollView.frameLayoutGuide.rightAnchor,
                             paddingTop: 0,
                             paddingLeft: 0,
                             paddingBottom: 0,
                             paddingRight: 0)
  
          
          contentView.addSubview(viewLabel0)
          viewLabel0.anchor(top: view.safeAreaLayoutGuide.topAnchor, paddingTop: 40.0)
          viewLabel0.centerX(inView: contentView)
  
          contentView.addSubview(viewLabel1)
          viewLabel1.anchor(top: viewLabel0.bottomAnchor, paddingTop: 40.0)
          viewLabel1.centerX(inView: contentView)
  
          contentView.addSubview(viewLabel2)
          viewLabel2.anchor(top: viewLabel1.bottomAnchor, paddingTop: 40.0)
          viewLabel2.centerX(inView: contentView)
  
          contentView.addSubview(viewLabel3)
          viewLabel3.anchor(top: viewLabel2.bottomAnchor, paddingTop: 40.0)
          viewLabel3.centerX(inView: contentView)
  
          contentView.addSubview(viewLabel4)
          viewLabel4.anchor(top: viewLabel3.bottomAnchor, paddingTop: 40.0)
          viewLabel4.centerX(inView: contentView)
  
          contentView.addSubview(viewLabel5)
          viewLabel5.anchor(top: viewLabel4.bottomAnchor, paddingTop: 40.0)
          viewLabel5.centerX(inView: contentView)
  
          contentView.addSubview(viewLabel6)
          viewLabel6.anchor(top: viewLabel5.bottomAnchor, paddingTop: 40.0)
          viewLabel6.centerX(inView: contentView)
  
          contentView.addSubview(viewLabel7)
          viewLabel7.anchor(top: viewLabel6.bottomAnchor, paddingTop: 40.0)
          viewLabel7.centerX(inView: contentView)
  
          contentView.addSubview(viewLabel8)
          viewLabel8.anchor(top: viewLabel7.bottomAnchor, paddingTop: 40.0)
          viewLabel8.centerX(inView: contentView)
  
          contentView.addSubview(viewLabel9)
          viewLabel9.anchor(top: viewLabel8.bottomAnchor, paddingTop: 40.0)
          viewLabel9.centerX(inView: contentView)
  
          contentView.addSubview(viewLabel10)
          viewLabel10.anchor(top: viewLabel9.bottomAnchor, paddingTop: 40.0)
          viewLabel10.centerX(inView: contentView)
  
          contentView.addSubview(viewLabel11)
          viewLabel11.anchor(top: viewLabel10.bottomAnchor, paddingTop: 40.0)
          viewLabel11.centerX(inView: contentView)
  
          contentView.addSubview(viewLabel12)
          viewLabel12.anchor(top: viewLabel11.bottomAnchor, paddingTop: 40.0)
          viewLabel12.centerX(inView: contentView)
  
          contentView.addSubview(viewLabel13)
          viewLabel13.anchor(top: viewLabel12.bottomAnchor, paddingTop: 40.0)
          viewLabel13.centerX(inView: contentView)
  
          contentView.addSubview(viewLabel14)
          viewLabel14.anchor(top: viewLabel13.bottomAnchor, paddingTop: 40.0)
          viewLabel14.centerX(inView: contentView)
  
          
          
          
      }
  
  
  }
  </code></pre>
  <p>I feel I have tried everything from looking in stack overflow to searching online but I simply cannot get it to scroll the list of labels I have created.</p>