John-Lluch / SWRevealViewController

A UIViewController subclass for presenting side view controllers inspired on the FaceBook and Wunderlist apps, done right !
Other
4.52k stars 987 forks source link

UIPanGesture seems to override UISlider gestures. #234

Closed onelittlebird closed 10 years ago

onelittlebird commented 10 years ago

Hi,

it seems to me that the implemented pan gesture (activated with [revealViewController panGesture]) overrides the gestures of the UISlider.

My subviews that are of the type UIScrollView work as intended (when scrolling left/right, not firing the gesture for the revealViewController) - but the UISlider doesn't work at all.

If I disable the revealViewController panGesture, then the slider works.

Also, I read somewhere that the panGesture wouldn't fire if a subview had userInteraction set to false - but I can't seem to get that to work - as the revealViewControllers gesture always fire.

Do you know if this is a known bug, or have I missed a couple of steps?

John-Lluch commented 10 years ago

The panGesturerecognized is attached by default to a view which is the superview of your front controller view, so disabling userInteraction on any of your views does not have any effect to the recognizer. This is by design to allow you to disable interaction on your controller without affecting the panning ability. If you want to disable the recognizer then you can use the delegate or attach the recognizer to the view you are disabling, for example your front controller view. This was already discussed several times.

I can't not reproduce your issue with the UISlider. I tried to add a UISlider on the front controller of the RevealControllerProject example but it worked for me just fine. Still, you can try to set cancelsTouchesInView to NO to prevent the gesture from delivering touch events to your views.

Thanks