0

在我的代码中默认工作 UITapGesture 如何删除它

NSString *dirString;

主机是类对象

-(Void) handleSwipeEvent : (UISwipeGestureRecognizer *) recognizer {

//NSString *swipeDirection = NULL;
//CGPoint location = [recognizer locationInView:self];
dirString = NULL;
UITapGestureRecognizer *tap=nil;
tap.enabled=NO;
if ([recognizer direction] == UISwipeGestureRecognizerDirectionLeft) {
    dirString = kCATransitionFromRight;

}

if ([recognizer direction] == UISwipeGestureRecognizerDirectionRight)
{
    dirString = kCATransitionFromLeft;
}

if (dirString) [host swipeTo:dirString];


} 
-(void)createSwipeGestureRecognizer:(UIView *)view direction:  (UISwipeGestureRecognizerDirection)direction
{

UISwipeGestureRecognizer *recognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeEvent:)];
[view addGestureRecognizer:recognizer];
[recognizer setDirection:direction];
[self setSwipeRecognizer:recognizer];
[recognizer release];

}

- (void) setHost: (FlashCardViewController *) aHost {

host = aHost;
[self createSwipeGestureRecognizer:self direction:UISwipeGestureRecognizerDirectionLeft];
[self createSwipeGestureRecognizer:self direction:UISwipeGestureRecognizerDirectionRight];

}

在视图上我必须触摸然后加载下一个内容。如何禁用点击事件

4

0 回答 0