Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
UITapGesture(このジェスチャをself.viewに追加)をself.view(風景)の左半分でのみ認識したいのですが、どうすればよいですか?
これを行う最も簡単な方法は、ジェスチャレコグナイザーの処理方法でこれをテストすることだと思います。したがって、ダブルタップを検出するときは、原点(reconigzerのlocationInViewメソッドから取得できます)のX値がビューの幅の半分未満であるかどうかをテストする条件があります。タップが左側にあることがわかっている場合は、次に進むことができます。
locationInView
X