The func scrollViewDidScroll(_ scrollView: UIScrollView) delegate method func scrollViewDidScroll(_ scrollView: UIScrollView) does the trick, but it is called every time scrollview moves the point. A less hyperactive alternative may be the following:
func scrollViewWillEndDragging(scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer<CGPoint>){ if targetContentOffset.memory.y == 0.0 { println("Reached the Top") }
It lets the delegate know that the scrollView will reach the top before it gets there, and since targetContentOffset is a pointer, you can change its value to adjust where the scrollview ends its scroll animation.
source share