为什么我的gestureRecognizer:shouldReceiveTouch:方法没有被调用?

时间:2013-08-09 11:11:34

标签: ios uipageviewcontroller

我正在为iOS 6创建UIPageViewController的子类:

#import "BGPageViewControllerWithoutTap.h"

@interface BGPageViewControllerWithoutTap ()

@end

@implementation BGPageViewControllerWithoutTap

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
{
    if ([gestureRecognizer isKindOfClass:[UITapGestureRecognizer class]])
    {
        return NO;
    }
    return YES;
}
@end

我认为UIPageViewController是所有手势识别器的默认委托。所以我希望调用gestureRecognizer:shouldReceiveTouch:

但它没有被召唤。

我做错了什么?

0 个答案:

没有答案