I have a UItableView that I want the 'view' height to change, based on the amount of cells (data) it has in it. I'm not talking about the cell heights, but the entire table itself. Is there a way to assign the height based on the amount of rows are in the table from data that is transferred to it?
Best How To :
1 approach could be set some autolayout constraints on the UITableView itself. For example, if you want to position a UIButton underneath your tableview, then you can go into your Storyboard and set the "vertical spacing" between the bottom of the TableView and the top of the Button to be a specific constant. This way, it would not matter how many cells you have.
I think this is a better approach than potentially trying to dynamically calculate a 'view height' based on the number of cells.