UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(didLongPress:)];
[self.view addGestureRecognizer:longPress];
longPress.minimumPressDuration = 1.f;
longPress.allowableMovement = 50.f;
- (void)didLongPress:(UILongPressGestureRecognizer *)sender
{
// 「ロングタップ開始」以外は、無視する
if ([sender state] != UIGestureRecognizerStateBegan) {
return;
}
}
最終更新:2016年07月21日 16:28