Animate scrolling when using UITableView's section index

I'm setting up a pretty basic UITableView with a section index. I've noticed that when I 'tap' on a section label in the iOS Simulator, the TableView jumps immediately to that section. I wanted the list to animate the scrolling, like how you can request animation when scrolling with scrollToRowAtIndexPath. Is this possible?

Yes, of course you can.

There is a function that allows that:

func scrollToRowAtIndexPath(_ indexPath: NSIndexPath,
           atScrollPosition scrollPosition: UITableViewScrollPosition,
                   animated animated: Bool)


Just set animated flag to true. Or maybe I'm didn't get your question 😊.

Animate scrolling when using UITableView's section index
 
 
Q