Is there any way by which I can get row height of each row in a UITableView
. I have a UITableView
which contains data which is dynamic, and I am using
self.tableView.rowHeight = UITableViewAutomaticDimension
to make dynamic row heights.
But I want to change height of overall UITableView
as well, for that I need height of all the rows after reload of data.
I tried using
self.tableView.layoutIfNeeded()
self.tableViewHeightContraint.constant = self.tableView.contentSize.height
But due to unknown reason it is giving me height less than what exactly it has, after I add 3 or 4 records in UITableView
so thinking of other way around. To calculate height of each rows and then summing them up.
I am doing in Xcode 7.2, iOS 9 and Swift 2