0
votes

I have problem with UIScreenEdgePanGestureRecognizer. I add .left edge for this gesture for swiping hamburger menu, but I have UISlider control on this screen, which left edge binded to left edge of the screen. When I swipe from left to right on my UISlider control, instead of changing its value screen shows me hamburger menu. How to partially disable left edge recognizer in slider area, but stay enable in other parts of this screen?

2

2 Answers

0
votes

I've implemented 'require to fail' in overlapping gesture recognizer situations where you don't want a recognizer to respond.

leftEdgeRecognizer.require(toFail: sliderAreaRecognizer)

This will cause the the left edge swipe to fail or " be disabled" where the slider recognizer is active.

-1
votes

Set a delegate to your UIScreenEdgePanGestureRecognizer, implement shouldRecognizeSimultaneouslyWithOtherGestureRecognizer function and return false.