title: how to increase the textview size according to text in static table view in swift 3
body: <p>I have 3 custom cells in Static TableView. All cells have different heights. But I need to make height of newsDetail TextView dynamic according to its content size. It was easy to make dynamic for label in tableview. But it didn't work out for TextView in Static TableView. I searched but couldn't find proper solution for this, anyone please could help me in swift 3? My codes: </p>
  
  <pre><code>import UIKit
  
  
  
  class DetailTableView: UITableViewController {
  
  @IBOutlet weak var myImageView: UIImageView!
  
  
  @IBOutlet weak var newsHeadline: UILabel!
  
  
  @IBOutlet weak var newsDetail: UITextView!
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
     newsDetail.text = "Barack Hussein Obama II (US: /bəˈrɑːk huːˈseɪn oʊˈbɑːmə/ (About this sound listen) bə-RAHK hoo-SAYN oh-BAH-mə;[1][2] born August 4, 1961) is an American politician who served as the 44th President of the United States from 2009 to 2017. He is the first African American to have served as president. He previously served in the U.S. Senate representing Illinois from 2005 to 2008 and in the Illinois State Senate. Obama was born in 1961 in Honolulu, Hawaii, two years after the territory was admitted to the Union as the 50th state. Raised largely in Hawaii, Obama also spent one year of his childhood in Washington State and four years in Indonesia. After graduating from Columbia University in 1983, he worked as a community organizer in Chicago. In 1988 Obama enrolled in Harvard Law School, where he was the first black president of the Harvard Law Review. After graduation, he became a civil rights attorney and professor, and taught constitutional law at the University of Chicago Law School from 1992 to 2004. Obama represented the 13th District for three terms in the Illinois Senate from 1997 to 2004, when he ran for the U.S. Senate."
  
  
      tableView.estimatedRowHeight = 44
      tableView.rowHeight = UITableViewAutomaticDimension
  
  
  }
  
  override func numberOfSections(in tableView: UITableView) -&gt; Int {
      // #warning Incomplete implementation, return the number of sections
      return 1
  }
  
  override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
      // #warning Incomplete implementation, return the number of rows
      return 3
  }
  
  public override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -&gt; CGFloat {
      return UITableViewAutomaticDimension
  }
  }
  </code></pre>