我有一些麻烦来处理iPhone上的滑动,我在我的界面中创建了一个UISwipeGestureRecognizervar:
UISwipeGestureRecognizer *swipeRecognizer;@H_404_4@并在我的控制器中:viewDidLoad方法
- (void)viewDidLoad { [super viewDidLoad]; // Horizontal swipe swipeRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeMethod:)]; swipeRecognizer.direction = UISwipeGestureRecognizerDirectionRight | UISwipeGestureRecognizerDirectionLeft; [self addGestureRecognizer:swipeRecognizer]; }@H_404_4@我的方法来处理刷卡是:
-(void)swipeMethod: (UISwipeGestureRecognizer *) sender { NSLog(@"Swipe!"); }@H_404_4@当我运行代码并进行滑动时,我什么都没有?我应该得到:滑动! @H_404_4@谢谢.