mardi 4 août 2015

Three-Finger UIPanGestureRecognizer doesn't work when Accessibility -> Zoom is on in "Settings App"

So, I have this code which basically creates a UIPanGestureRecognizer and adds it to the view. In the target method I am just printing the number of touches. It works fine under normal circumstance; and print correct number of touches.

But if "Settings -> Accessibility -> Zoom" is turned On, then it fails for 3-finger touch.

- (void)viewDidLoad
{
  [super viewDidLoad];
  UIPanGestureRecognizer *tempGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handleTempGesture:)];
  tempGesture.minimumNumberOfTouches = 1;
  tempGesture.maximumNumberOfTouches = 3;
  [tempGesture setDelegate:self];
  [self.view addGestureRecognizer:tempGesture];
}

- (void)handleTempGesture:(UIGestureRecognizer *)recognizer
{
  NSUInteger touches = recognizer.numberOfTouches;
  NSLog(@"Touches Count: %i", (int)touches);
}

Is there a way around it i.e. without having to turn off the zoom.

PS: Even 3-Finger UITapGestureRecognizer doesn't work.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire