In short, I need to know exactly when the scrollview stopped scrolling. By \'stopped scrolling\', I mean the moment at which it is no longer moving and not being touched.
It is important to understand, that the when UIScrollView is stopping to move it triggers two different functions of the UIScrollViewDelegate depending on how strong the user has pushed.
So in conclusion it is necessary to combine the two functions like @WayneBurkett already pointed out in his answer.
In Swift 5.X:
func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
myFunction()
}
func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) {
if decelerate == false {
myFunction()
}
}
private func myFunction() {
// scrollView did stop moving -> do what ever
// ...
}