我想添加到我的UIViewController
:
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapGesture:)];
tapGesture.numberOfTapsRequired = 2;
[self.view addGestureRecognizer:tapGesture];
[tapGesture release];
UITapGestureRecognizer *tapGesture2 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapGesture2:)];
tapGesture2.numberOfTapsRequired = 1;
[self.view addGestureRecognizer:tapGesture2];
[tapGesture2 release];
问题是如果用户点击两次调用这两种方法,我希望如果用户双击只有第一个(handleTapGesture)会被调用,如果他点击一次它只会调用第二个(handleTapGesture2)