I have a table view, I need the indexpath of the row that is passing at the very top (0,0) of the tableview, I try to use the indexPathForRow(at:) which is expecting a cgpoint, I try CGPoint.zero to get the row, but the indexPath is always nil, I read that I need to play with offset of the scrollView and that point need to be in the local coordinate but so far no luck
func scrollViewDidScroll(_ scrollView: UIScrollView) {
let cgPoint = CGPoint.zero
let indexPath = tableView.indexPathForRow(at: cgPoint)
}
Thanks for any help!