Domanda

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.

È stato utile?

Soluzione

You can add a delegate to self.slidingViewController.panGesture and have it ignore touches that are on a UISlider view. The following question and answer have all the information you need: Pan gesture interferes with UISlider.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top