Question: How to change the size of the label automatically in table cells? 

I've already written 

```
    tableView.rowHeight = UITableViewAutomaticDimension

    tableView.estimatedRowHeight = 240

```

in `viewDidLoad()`, 

and 

```
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
    return UITableViewAutomaticDimension
}

```

and already set "Lines" 0 to show text in multiple lines.

so, if I set the text previously, it shows text in a few lines and change the size of the label automatically, but if I make a display to input text and the label shows what I input, it becomes in a line and doesn't change the size of the label. 

What else do I need to do?

Thanks.

Answer: 
To realod, I added 

```
override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)
    tableView.reloadData()
}

```

Thanks!
Hope it helps you write these two lines in view did load

```
tableView.estimatedRowHeight = 80
tableView.rowHeight = UITableViewAutomaticDimension

```