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