0
votes

I have read a few posts asking about to put UITableViews inside a ScrollView but mostly this idea is not recommended. The "standard way" to handle this situation as I understand is to use just the UITableView instead of the ScrollView and make the TableView header the UIView to display the content and to use the cell to display any dynamic rows.

However the app I am now developing is a bit different: the first part of the view is some descriptive content that I can use the header view to display. But after that I want to display two scrollable sections potentially with dynamic height. One is a comment section displaying all comments and replies and another is a user section that display any users ever made an offer. This two sections need to be row-based and will be dynamic in height as the content inside them will be different.

So the question is, how should I implement this without putting two UITableViews inside a UIScrollView(My original plan)?

1
You can have two sections in the tableview - harshal jadhav

1 Answers

0
votes

UITableViews inside a ScrollView is not at all recommended as UITableView as its own scrollView as subView.

This two sections need to be row-based and will be dynamic in height as the content inside them will be different.

Whats wrong with using the delegate for dynamic height for row

func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {}

Some Tutorial: https://www.raywenderlich.com/129059/self-sizing-table-view-cells