In my calendar app, I want my UITableView to scroll to a specific section based on which date is tapped. Current implementation is below:
- (void)calendarDidDate
When your section has no cells, for example it has just a header or footer, you can use one of the following options:
let sectionRect = yourTable.rect(forSection: sectionNumber)
yourTable.setContentOffset(CGPoint(x: sectionRect.origin.x, y: sectionRect.origin.y), animated: true)
or
let sectionRect = yourTable.rect(forSection: sectionNumber)
yourTable.scrollRectToVisible(sectionRect, animated: false)