I’m developing an app for iOS with a menu like Facebook with ECSlidingViewController, a nice project to manage the horizontal gesture on the app.
The problems borns when I put into the view an UISlider… I can’t touch it nice because the sliding motion of the sliders is being mistaken as a swipe left/right.
This is the header file of che class with all the methods and this is the code to put in the main view:
if (![self.slidingViewController.underLeftViewController isKindOfClass:[MenuViewController class]]) {
self.slidingViewController.underLeftViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"Menu"];
}
if (![self.slidingViewController.underRightViewController isKindOfClass:[UnderRightViewController class]]) {
self.slidingViewController.underRightViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"UnderRight"];
}
[self.view addGestureRecognizer:self.slidingViewController.panGesture];
This last line is the code that integrate the gesture on the app.
Is there a method to disable the gesture only on the uislider?
Thanks at all.
You can add a delegate to
self.slidingViewController.panGestureand have it ignore touches that are on aUISliderview. The following question and answer have all the information you need: Pan gesture interferes with UISlider.