Closed zhugexiaobo closed 11 years ago
Hi, If I understood you correctly you have centerViewController that has UITableView in which each cell has panGestureRecognizer? I had similar problems like that, but it is not a problem of PPRevealSideViewController, you need to disable touches by your self. Here is one example how you can do it:
In centerViewController add this:
(void) observeValueForKeyPath:(NSString )keyPath ofObject:(id)object change:(NSDictionary )change context:(void *)context {
if ([keyPath isEqualToString:@"self.navigationController.view.frame"]) {
if (CGRectGetMinX(self.navigationController.view.frame) == 0) {
self.tableView.userInteractionEnabled = NO;
//or you can try with this self.tableView.allowsSelection = NO;
}
else {
self.tableView.userInteractionEnabled = NO;
//or you can try with this self.tableView.allowsSelection = NO;
}
} }
(void) dealloc {
[self removeObserver:self forKeyPath:@"self.navigationController.view.frame"]; }
In example you need to observe your contentViewController.view.frame and when frame changes that means that your PPRevealSideViewController is moving your contentViewController. When that happens you just need to disable touches on your tableView and your tapGestureRecognizer will collect touches.
That's helpful.Thanks for the good solution.
hi, I have a tableView on my contentView and each tableViewCell has panGesture.When the left side viewController opened,I can still do the panGesture on the contentView,that's kind of odd. So how can I keep the tapGesture enable to close the left side VC and disable the panGesture on the contentView. btw I hidden the navigationBar for some reason.Thanks :)