title: Tableview menu not scrolling till the bottom swift
body: <p>I have a slight problem, my menu which I created doesn't seem to want to scroll till the bottom.</p>
  <p>I have created it programmaitacally</p>
  <pre><code>var dataSource = [String]()
  
  override func viewDidLoad() {
      super.viewDidLoad()
      tableView.delegate = self
      tableView.dataSource = self
      tableView.register(CellClass.self, forCellReuseIdentifier: &quot;Cell&quot;)
      
  }
  
  func addTransparentView(frames: CGRect) {
      let window = UIApplication.shared.keyWindow
      transparentView.frame = window?.frame ?? self.view.frame
      self.view.addSubview(transparentView)
      
      tableView.frame = CGRect(x: frames.origin.x, y: frames.origin.y + frames.height, width: frames.width, height: 50)
      self.view.addSubview(tableView)
      tableView.layer.cornerRadius = 4
  transparentView.backgroundColor = UIColor.black.withAlphaComponent(0.9)
      tableView.reloadData()
      let tapgesture = UITapGestureRecognizer(target: self, action: #selector(removeTransparentView))
      transparentView.addGestureRecognizer(tapgesture)
      transparentView.alpha = 0
      
      UIView.animate(withDuration: 0.4, delay: 0.0, usingSpringWithDamping: 2.0, initialSpringVelocity: 2.0, options: .curveEaseInOut,animations: {
          self.transparentView.alpha = 0.5
          self.tableView.frame = CGRect(x: frames.origin.x, y: frames.origin.y + frames.height + 1, width: frames.width, height: CGFloat(self.dataSource.count * 50))
      }, completion: nil)
      
      
  }
  
  @objc  func removeTransparentView() {
      let frames = selectedButton.frame
      UIView.animate(withDuration: 0.4, delay: 0.0, usingSpringWithDamping: 1.0, initialSpringVelocity: 1.0, options: .curveEaseInOut,animations: {
          self.transparentView.alpha = 0
          self.tableView.frame = CGRect(x: frames.origin.x, y: frames.origin.y + frames.height, width: frames.width, height: 0)
      }, completion: nil)
  }
  
  @IBAction func onClickSelectProperty(_ sender: Any) {
      dataSource = [&quot;Apartment A3&quot;,&quot;Apartment A4&quot;,&quot;Apartment A5&quot;,&quot;Apartment A6&quot;,&quot;Apartment A8&quot;,&quot;Apartment A9&quot;,&quot;Apartment A12&quot;,&quot;Apartment E1&quot;,&quot;Sectional Title 50A&quot;,&quot;Sectional Title 65A&quot;,&quot;Free Standing 70A&quot;,&quot;Free Standing 70A Core&quot;,&quot;Free Standing 85A&quot;,&quot;Free Standing 100A&quot;]
      selectedButton = btnSelectPropert
      addTransparentView(frames: btnSelectPropert.frame)
  }
  </code></pre>
  <p>I would like to scroll till the bottom, somehow it doesn't allow me</p>
  <p><a href="https://i.stack.imgur.com/7IXlB.png" rel="nofollow noreferrer">how the table/menu looks like</a></p>