2

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.

PanxShaz
  • 760
  • 9
  • 12

1 Answers1

1

No. However, you can alert users to the conflict and offer them the option to disable Accessibility Zoom using the UIAccessibilityRegisterGestureConflictWithZoom() API. Make sure to offer an alternative way to activate the feature so that users of zoom and other accessibility features can fully enjoy your application.

Justin
  • 20,509
  • 6
  • 47
  • 58