ios - How to check how much the first row is hidden in UITableView without using contentOffset? -
i need know how of first cell hidden current scroll in uitableview
. in other words, @ point in cell's coordinates, cell not covered yet?
the contentoffset
cannot used because calculate myself.
you have indexpath
first visible row, , convert origin cell's coordinates:
if let firstvisibleindexpath = indexpathsforvisiblerows?.first { if let cell = cellforrowatindexpath(firstvisibleindexpath) { let coveredheightoffirstvisiblecell = tableview.superview!.convertpoint(tableview.frame.origin, toview: cell).y } }
Comments
Post a Comment