English 中文(简体)
通过UIGestureRecognizer paraile to selectedor
原标题:Passing UIGestureRecognizer parameter to selector

我有办法处理我在别处宣布的双轮wi:

-(void)handleDoubleSwipe:(UISwipeGestureRecognizer *)recognizer
{
    NSLog(@"double swiped");
    if(recognizer.direction==UISwipeGestureRecognizerDirectionLeft) {
        NSLog(@"swiped left");
     }
     if(recognizer.direction==UISwipeGestureRecognizerDirectionRight) {
         NSLog(@"swiped right");
     }

}

我宣布:

    UISwipeGestureRecognizer *doubleSwipe=[[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleDoubleSwipe:)];
    doubleSwipe.numberOfTouchesRequired=2;
    doubleSwipe.delegate=self;
    doubleSwipe.direction=UISwipeGestureRecognizerDirectionRight | UISwipeGestureRecognizerDirectionLeft;

问题是,Im无法向甄选者提供任何参数。 这只是让我去做,使我能够完成零件工作。 我将如何在选择人的参数上添加双Swipe的姿态? 如今,操作的DoubleSwipe方法确实被叫去,国家行车监督记录仪显示的是“双血清”但确实显示左或右.。

最佳回答

The direction property of the recognitionr notess about the guidance (s) the recognitionr Hands (just as You configued it), not the guidance of the actual swipe.

您可使用<代码>所在地点 在意见中: 方法与state 财产相结合,以确定 s草何时开始和结束。

通过为每一方向使用一台识别器可能比较容易。

问题回答

暂无回答




相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签