title: Tableview's contentView smaller than tableview frame and cell
body: <p>I'm creating a Tableview programatically with the following code: </p>
  
  <pre><code> override func viewDidLayoutSubviews() {
      //@begin store selection - settings
      self.tbStores = UITableView(frame: CGRect(x: 15, y: 60, width: UIScreen.main.bounds.size.width - 30, height: 150))
      self.tbStores.register(UITableViewCell.self, forCellReuseIdentifier: "Cell")
      tbStores.backgroundColor = UIColor.white
      tbStores.delegate = self
      tbStores.dataSource = self
      tbStores.allowsSelection = true;
      tbStores.translatesAutoresizingMaskIntoConstraints = true
   }
  </code></pre>
  
  <p>and adding in ViewAutoComplete created programatically too</p>
  
  <pre><code>if (viewAutoComplete == nil) {
              self.viewAutoComplete = UIView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.size.width, height: UIScreen.main.bounds.size.height))
              viewAutoComplete.backgroundColor = UIColor(red: 32 / 255.0, green: 48 / 255.0, blue: 90 / 255.0, alpha: 1)
              viewAutoComplete.alpha = 1
              viewAutoComplete.translatesAutoresizingMaskIntoConstraints = true
              self.viewAutoComplete.tag = 123
      self.view!.addSubview(viewAutoComplete)
              viewAutoComplete.addSubview(tbStores)
  }
  </code></pre>
  
  <p>The problem is that the contentView is smaller than cell and tableview like the following screenshots</p>
  
  <p><a href="https://i.stack.imgur.com/y9Fub.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/y9Fub.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/svYBc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/svYBc.png" alt="enter image description here"></a></p>