TomThorpe / TTRangeSlider

A slider, similar in style to UISlider, but which allows you to pick a minimum and maximum range.
MIT License
968 stars 204 forks source link

Fixed interaction with gesture recognizers #97

Closed 696GrocuttT closed 5 years ago

696GrocuttT commented 5 years ago

If the range slider is placed on a view with a gesture recognizer (eg a scroll view) the gesture recognizer can grab touch events making the slider difficult to control. The Apple documentation for the UIView gestureRecognizerShouldBegin method mentions that this method is used by UISlider to overcome this issue, so this is the approach this patch uses.

The new page sheet presentation style in iOS 13 makes it more likely that the view the range slider is on will have a gesture recognizer, and therefore be effected by this problem.

While debugging this issue similar symptoms to issue #69 ("Handle stays enlarged when tapped during drag of parent view") were encountered and fixed. The exact reproduction steps described in issue 69 haven't been retested, but it's possible this patch also fixes that issue.

TomThorpe commented 5 years ago

Thank you very much for this - looks great and much appreciated!