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
Take outlet of tableview height and set it with your tableview row height in cellForRowAt like this,
tableviewHeight.constant = (tableView.contentSize.height * no_of_rows) + bottom_space