Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8797265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:49:09+00:00 2026-06-13T23:49:09+00:00

I am trying to disable the pan gesture recognizer for a UIPageViewController. On iOS

  • 0

I am trying to disable the pan gesture recognizer for a UIPageViewController.

On iOS 5 I can loop through them and disable them.

for (UIGestureRecognizer* recognizer in self.pageViewController.gestureRecognizers) {
    if ([recognizer isKindOfClass:[UIPanGestureRecognizer class]]) {
        recognizer.enabled = NO;
    }
}

On iOS 6 using UIPageViewControllerTransitionStyleScroll there are no gesture recognizers returned by the Page View Controller.

Clarification

This can be boiled down to:

self.pageViewController.gestureRecognizers = 0 when UIPageViewController’s transition style is set to scroll so I can’t access the gesture recognizers.

Is there any way I can get around this? I don’t think I am doing anything wrong since the curl transition works fine.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T23:49:10+00:00Added an answer on June 13, 2026 at 11:49 pm

    There is a bug filed in radar for this behavior. So, I bet that until Apple fixes it there will be no chance to solve this.

    One workaround that comes to my mind is laying a transparent subview on top of your UIPageViewController and add to it a UIPanGestureRecognizer to intercept that kind of gesture and not forward further. You could enable this view/recognizer when disabling the gesture is required.

    I tried it with a combination of Pan and Tap gesture recognizers and it works.

    This is my test code:

    - (void)viewDidLoad {
      [super viewDidLoad];
    
       UIPanGestureRecognizer* g1 = [[[UIPanGestureRecognizer alloc] initWithTarget:self
                                                                          action:@selector(g1Pan:)] autorelease];
      [self.view addGestureRecognizer:g1];
    
      UITapGestureRecognizer* s1 = [[[UITapGestureRecognizer alloc] initWithTarget:self
                                                                          action:@selector(g1Tap:)] autorelease];
    
      [self.view addGestureRecognizer:s1];
    
      UIView* anotherView = [[[UIView alloc]initWithFrame:self.view.bounds] autorelease];
      [self.view addSubview:anotherView];
    
      UIPanGestureRecognizer* g2 = [[[UIPanGestureRecognizer alloc] initWithTarget:self
                                                                          action:@selector(g2Pan:)] autorelease];
      [anotherView addGestureRecognizer:g2];
    
    }
    

    When g2 is enabled, it will prevent g1 from being recognized. On the other hand, it will not prevent s1 from being recognized.

    I understand this is hack, but in the face of a seeming bug in UIPageViewController (at least, actual behavior is blatantly different from what the reference states), I cannot see any better solution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to disable access logging (access_log) for domains. I can't find a way
I'm trying to disable HTTP keep-alive , and I can't seem to find any
I am trying to disable hyperlinks and show them in plain text using HTMLPurifier
I'm basically trying to disable the scroll on List View. Which can be done
I am trying to disable a function in JavaScript so that it only can
I am simply trying to disable the DRILL-DOWN effect on my 'Column Chart'. Can
Im trying to disable a feature on mobile safari, but not really sure how
I am trying to disable the logo in my metro app live tile so
I am trying to disable the system keyboard shortcuts with following code: #import AppDelegate.h
I am trying to disable a particular cell in a particular table. I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.