I am trying to get a UITableview to go to the top of the page when I reload the table data when I call the following from
- (void)pickerView:(UIPickerView *)pic
After reading all of the answers here and elsewhere, I finally found a solution that works reliably and does not show the scrolling after the data is loaded. My answer is based on this post and my observation that you need a negative offset if you are using content insets:
func reloadAndScrollToTop() {
tableView.reloadData()
tableView.layoutIfNeeded()
tableView.contentOffset = CGPoint(x: 0, y: -tableView.contentInset.top)
}