I am working on a screen for an app using storyboard.
I have placed a UIScrollView and within this a UIVIew. The idea is for the screen to have the following items (starting from the top) inside the UIVIew:
- An image view
- A title label (single line)
- A description label (multiple lines, dynamic)
- A table view (dynamic)
I have set the following constraints:
- Scroll View: 0 top, 0 leading, 0 trailing, 0 bottom
- UIView: 0 top, 0 leading, 0 trailing, 0 bottom, equal widths with view controller
Then within this view:
- Image View: 0 top, 0 leading, 0 trailing, aspect ratio
- Title: 8 top, 16 trailing, 16 leading
- Description: 8 top, 16 trailing, 16 leading
- Table View: 20 top, 0 leading, 0 trailing, 20 bottom
I have tried similar approaches in other screens but only with labels and views and there haven't been any problems. However here it's expecting me to give the table view a height which I can't because the number of rows to be loaded is unknown (if I set a height all auto layout issues go away).
How can I constrain the Table View in relation to the other views?
I am working on XCode 10 for iOS 11, with Swift 4.2.