Table View - How to tap a cell and automatically move the next cell to the top?

Solved :slight_smile: This worked:

currentInstructionIndex += 1
        let indexPathTest = IndexPath(row: currentInstructionIndex, section: 0)
        tableView.scrollToRow(at: indexPathTest, at: UITableView.ScrollPosition.top, animated: true)

The tableView.scrollToRow method is what I was looking for. More info here for anyone who’s interested: https://developer.apple.com/documentation/uikit/uitableview/scrollposition

1 Like