-1

I'm using table view custom cell in my application in swift language.I am performing scaling animation for cell while scrolling up and down. I need to detect whether the cell is fully visible during my scrolling. Can any one help me out regarding this. Thanks in advance.

Mohit Kumar Arora
  • 2,204
  • 1
  • 19
  • 27
Venkat_09
  • 119
  • 1
  • 6

2 Answers2

3

You can use visibleCells property on UITableView, and check if your cell is there. Check out the apple documentation for UITableView.

0

You can get the rect of a cell with rectForRowAtIndexPath: method and compare it with tableview's bounds rect using CGRectContainsRect function.

Note that this will not instantiate the cell if it is not visible, and thus will be rather fast.

let cellRect = tableView.rectForRowAtIndexPath(indexPath)
let completelyVisible = tableView.bounds.contains(cellRect)