title: dynamic cell height in ios using constrain programatically in swift
body: <p>I am working on a project in swift which needs the cell size to be dynamic according to the label content, so i searched for dynamic cell height, i found some solution but all of it included use of storyboard for assigning constrain. Is it possible to do it without storyboard. Is it possible to do it programatically? I mean applying self sizing without storyboard</p>
  
  <p>my code is:</p>
  
  <pre><code>class a: UITableViewDelegate, UITableViewDataSource {
      tableView = UITableView(frame: CGRectMake(0, 0, self.view.frame.width, self.view.frame.height), style: UITableViewStyle.Plain)
      tableView.delegate = self
      tableView.dataSource = self
      tableView.estimatedRowHeight = 100
      tableView.rowHeight = UITableViewAutomaticDimension
      self.view.addSubview(tableView)
  }
  </code></pre>
  
  <p>Hope the question is clear.</p>
  
  <p>Thanks in advance.</p>
  
  <p>Edit: None of the answers below is helpful</p>