I' have a code which detects last cell, but I am curious how to detect now the very first cell in tableView, because in my tableView not all cells are visible on device like iphone 7 or less that is why i have to use scroll method.
func scrollViewDidScroll(_ scrollView: UIScrollView) {
let contentOffsetMaxY: Float = Float(scrollView.contentOffset.y + scrollView.bounds.size.height)
let contentHeight: Float = Float(scrollView.contentSize.height)
let lastCellIsVisible = contentOffsetMaxY > contentHeight
if lastCellIsVisible {
//some action
}
}