Reputation: 151
I have a Tableview inside a Table View cell. The Tableview has a accordian view that can expand or collapse. How to resize the cell to the tableview height which changes dynamically?
Upvotes: 1
Views: 50
Reputation: 48
I would use a delegate.
Create a protocol that your outer table view controller conforms to:
func cellHeightChanged(newHeight: CGFloat) {
self.cellHeight = newHeight
self.tableView.reloadData()
}
Then give the inner table view a reference to the outer controller and call this method whenever the height changes.
Upvotes: 1