I see that I can remove all of the UIPageViewController gestures, but what if I only want to remove the tap gesture on the edges? And keep the swipe gesture? Is this possible?
Thanks
Try looping through pageViewController.gestureRecognizers
, disabling any that are tap recognizers.
Objective-C:
for (UIGestureRecognizer *recognizer in pageViewController.gestureRecognizers) { if ([recognizer isKindOfClass:[UITapGestureRecognizer class]]) { recognizer.enabled = NO; } }
Swift:
for recognizer in pageViewController.gestureRecognizers { if recognizer is UITapGestureRecognizer { recognizer.isEnabled = false } }
If you need to do this in Swift:
for recognizer in pageViewController.gestureRecognizers as! [UIGestureRecognizer] { if recognizer is UITapGestureRecognizer { recognizer.enabled = false } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With