2

The navigation bar can response the pan gestures in ZUUIRevealController. But I want to make the whole screen of frontViewController response the pan gestures like Path2, so I write code like this:

UIPanGestureRecognizer *recognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self.navigationController.parentViewController action:@selector(revealGesture:)];

[self.view addGestureRecognizer:recognizer];

It works fine except in UITableViewController. When I put it in viewDidLoad method of UITableViewController, the table can not response any other pan gestures, so it can not scroll.

How can I make it work like Path2: pan it horizontally is to reveal, and vertically is to works like normal table view?

gyro
  • 89
  • 7
  • take a look here http://stackoverflow.com/questions/2627934/simultaneous-gesture-recognizers-in-iphone-sdk/2628777#2628777 – mja Jun 10 '12 at 21:58

1 Answers1

6

There is a simple solution:

in the frontViewController:

- (void)viewDidLoad
{
...

    UIPanGestureRecognizer *recognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self.navigationController.parentViewController action:@selector(revealGesture:)];

    recognizer.delegate = self;

...
}

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
    return TRUE;
}
gyro
  • 89
  • 7