if (gesture.state == UIGestureRecognizerStateBegan) {
_initial = [gesture locationInView:self.view];
}else if (gesture.state == UIGestureRecognizerStateChanged){
CGPoint p = [gesture locationInView:self.view];
double dy = p.y - _initial.y;
if (dy > 0) {
NSLog(@"Finger moved to the up");
}
else {
NSLog(@"Finger moved to the down");
}
}
初期点を比較していないこれはUILongPressGestureRecognizer方向を検出するための私の方法ですが、私は が最初のポイントを比較したがのstateChangedポイントを比較していない方向を検出します。UILongPressGestureRecognizer方向を検出
フォーム0〜7は稼動していますが、7〜-5がダウンし、-5〜-2が稼働しています。
UILongPressGestureRecognizerは、あなたの投稿は "UIPanGestureRecognizer" と述べ –
translationInViewメソッドを持っていません。そして今、あなたは長引きを言う。また、パンニングを検出することができるような、長押しの認識装置はありません。彼らは2つの異なるものです。 – GeneCode