I have got TableView in the MainstoryBoard and the number of rows is random every time. I want the height of the whole TableView to be fl
TableView
MainstoryBoard
DispatchQueue.main.async { var frame = tableView.frame frame.size.height = tableView.contentSize.height tableView.frame = frame }
OR
DispatchQueue.main.async { self.TblViewHeightConstraint.constant = CGFloat((self.array.count) * 30)//Here 30 is my cell height self.TblView.reloadData() }