I'm trying to get the height of all of a table's contents so I can update the container it is in. This will allow the container and other views in the scroll view to scroll together.
Swift:
var tableViewHeight: CGFloat { tableView.layoutIfNeeded() return tableView.contentSize.height }
Objective-C
- (CGFloat)tableViewHeight { [tableView layoutIfNeeded]; return [tableView contentSize].height; }
2.1m questions
2.1m answers
60 comments
57.0k users