0

I'm trying to set indexPath for tableview to scroll to particular position. Instead of IndexPath(row: 0, section: 0), I used collection view IndexPath(item: 0, section: 0.

It's working as expected, just want to confirm will it make any difference.

let indexPath : IndexPath = IndexPath(item: 0, section: 0)

vs

let indexPath : IndexPath = IndexPath(row: 0, section: 0)

Below is my code snippet:

 let indexPath = IndexPath(item: 0, section: 0)
 tableView.scrollToRow(at: indexPath, at: .top, animated: true)
AP_
  • 1,013
  • 12
  • 13

0 Answers0