我正在为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:
。
但它没有被召唤。
我做错了什么?