I want to find out if a cell is displaying onscreen in a table view.
I tried out willDisplay
method but it's of no use. I even tried
if (tableView.indexPathsForVisibleRows?.contains(indexPath))! {
print("showing now")
}
This function works, But it doesn't print anything when the cell is on screen or as I scroll down. Ex: If I have 5 cells, As the app launches and the cell are on the display, nothing is printed. Also, when I scroll from cells 1 to 5, Nothing is displayed. On contrary, If I scroll back from cells 5 to 1, It will display it, which completely defies my purpose.
I hope you understood my query and can help me with an apt solution.
Cheers!