Daniel Que Daniel Que - 28 days ago 14
iOS Question

UITableView handler for cell will hide

The

UITableViewDelegate
has a convenient function,
willDisplay
.

I need to add a handler for when a cell hides, which is essentially the opposite of
willDisplay
. How can I detect this event?

Answer

The method you'll want to use is

func tableView(_ tableView: UITableView, didEndDisplayingCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath)

Documentation