title: tableView Cell Labels Stack When I Scroll
body: <p>I have a custom tableView, entirely created in code. IE, the cells need to be in code too.</p>
  <pre><code>func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
          let cell = tableView.dequeueReusableCell(withIdentifier: &quot;inventoryCell&quot;, for: indexPath)
  
  
              let namelabel = UILabel()
              namelabel.frame = CGRect(x: 145, y: 10 , width: 200, height: 30 )
              namelabel.text = itemToShow.name
              namelabel.font = UIFont.boldSystemFont(ofSize: 20)
              namelabel.backgroundColor = .clear
              cell.addSubview(namelabel)
  
              let detailLabel = UILabel()
              detailLabel.frame = CGRect(x: 145, y: 50 , width: 200, height: 50 )
              detailLabel.text = itemToShow.detail
              detailLabel.backgroundColor = .clear
              cell.addSubview(detailLabel)
  
              let inventoryImage = UIImageView()
              inventoryImage.frame = CGRect(x: 10, y: 10, width: 130, height: 130)
              inventoryImage.image = UIImage(named: &quot;emptyInventorySlot&quot;)
              cell.addSubview(inventoryImage)
  
          
          
          return cell
      }
  </code></pre>
  <p>It works great, and you can see it loads perfectly. The top image is the load, the bottom image is once I scroll to the bottom. You can see the text labels seem to all stack on top of each other.</p>
  <p><a href="https://i.stack.imgur.com/jNtIg.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jNtIg.jpg" alt="enter image description here" /></a></p>