I want to detect when the user lifts their finger in a UITableView while they scroll, so in the UIScrollView delegate method scrollViewDidScroll:
func scrollViewDidScroll(scrollView: UIScrollView)
{
// Some code…
if scrollView.panGestureRecognizer.state == .Ended
{
NSLog("ENDED")
}
}
To me this sounds like it should work, so when I investigated further and logged what states happen at this point, the only two logs were Changed and Possible.
To my understanding Ended should happen before possible if the gesture has ended.
Apple docs:
The gesture recognizer has received touches recognized as the end of a continuous gesture. It sends its action message (or messages) at the next cycle of the run loop and resets its state to UIGestureRecognizerStatePossible.
What exactly is going on here? And how do I find when the user lifts their finger off my UITableView during a scroll?