[xcode iPhone]两次快速触控
您好,我想知道一个可以识别一次触摸和两次快速触摸的按钮如何尝试向按钮添加以下操作[xcode iPhone]两次快速触控,iphone,xcode,action,Iphone,Xcode,Action,您好,我想知道一个可以识别一次触摸和两次快速触摸的按钮如何尝试向按钮添加以下操作 UIControlEventTouchDownRepeat 范例 这听起来可能有点骇人听闻,但如果[touch tapCount]==2,您可以将UIButton子类化,覆盖触摸事件,并执行魔术 不要开始扔东西!我知道这不优雅 UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; button.frame = C
UIControlEventTouchDownRepeat
范例
这听起来可能有点骇人听闻,但如果[touch tapCount]==2,您可以将UIButton子类化,覆盖触摸事件,并执行魔术 不要开始扔东西!我知道这不优雅
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
button.frame = CGRectMake(100.0, 100.0, 80.0, 50.0);
[button setTitle:@"Tap Me!" forState:UIControlStateNormal];
[button addTarget:self action:@selector(touchDownRepeat:) forControlEvents:UIControlEventTouchDownRepeat];
[self.view addSubview:button];