I'm trying to make a view that contains a TableView
with different cells of different heights that fit their content. But I do not find any example that works well.
What I do is implement a tableView
with a cell prototype to which I do not declare height. I'm filling content with a collectionView
with different items that if they exceed the total cell width of tableView
make a jump to the next line with a scrollVertical
.
I add the following code to viewDidLoad()
to do a vertical readjustment of the cell but it does not work:
tableView.estimatedRowHeight = 100
tableView.rowHeight = UITableViewAutomaticDimension