0

When i load data from database and call first time tableView.reloadData() and tableHeightConstraint.constant = tableView.contentSize.height it works perfect. But when i add new cell and do it again, it doesn't works. without tableHeightConstraint.constant = tableView.contentSize.height works but then i can't change height of tableView. it is important to change tableView height.

MRustamzade
  • 1,425
  • 14
  • 27

1 Answers1

0

UITableView is not a simple UIScrollView, its ContentSize from cells in the current view screen, not all cells.

If you add a cell out the current view bounds, it will not change the ContentSize.