title: Labels overlapping in UITableViewCell - Swift
body: <p>We are moving away from objective c and implementing the new code in Swift. I am facing problems with UITableViewCells. Whenever I add content in the cell and use UITableView to display it, the content of the cell gets cluttered. How do I prevent the "ques" "ans" label from overlapping?</p>
  
  <p>Output when I run the app:</p>
  
  <p><a href="https://i.stack.imgur.com/8ckXd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8ckXd.png" alt="enter image description here"></a></p>
  
  <p>The class controller goes like: </p>
  
  <pre><code>@objc public class ProfileViewController :UITableViewDelegate, UITableViewDataSource {
      @IBOutlet weak var detailTableView: UITableView! //connected to storyboard
      public override func viewDidLoad() {
          super.viewDidLoad()
          self.detailTableView.delegate = self;
          self.detailTableView.dataSource = self;
          self.detailTableView.register(UINib(nibName: "DetailTableViewCell", bundle: nil), forCellReuseIdentifier: "DetailTableViewCell")
      }
  
      public override func viewWillAppear(_ animated: Bool) {
          super.viewWillAppear(animated)
      }
  
      public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
          return 4
      }
  
      public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
          var cell = tableView.dequeueReusableCell(withIdentifier: "DetailTableViewCell", for: indexPath) as! DetailTableViewCell
          return cell
      }
  
  }
  </code></pre>
  
  <p>DetailTableViewCell class</p>
  
  <pre><code>@objc public class DetailTableViewCell: UITableViewCell {
     public override func awakeFromNib() {
          super.awakeFromNib()
      }
      public override func prepareForReuse() {
          super.prepareForReuse()
      }
      public override func setSelected(_ selected: Bool, animated: Bool) {
          super.setSelected(selected, animated: animated)
      }   
  }
  </code></pre>
  
  <p>Xib of cell class</p>
  
  <p><a href="https://i.stack.imgur.com/A99ga.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A99ga.png" alt="xib view of cell class"></a></p>
  
  <p>storyboard view of controller</p>
  
  <p><a href="https://i.stack.imgur.com/FEhAT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FEhAT.png" alt="storyboard view of controller"></a></p>
  
  <p>I believe there is something very obvious I am missing out because I defined all the constraints accurately. Can I please get some hints?</p>