線を引いているところが見えます。2本以上の指で線を引くと変な振る舞いがします。そのため、このビューでマルチタッチを無効にします。
私は試した :
self.drawingView.multipleTouchEnabled = NO;
self.drawingView.exclusiveTouch = YES;
ただし、影響はありません。そして、私のtouchesメソッドはまだ呼び出されています。理想的には、2本の指で描画しようとしても何もしません。解決策はありますか?
ありがとう :)
タッチ方法(開始/移動)で、画面に表示されているタッチの数を確認し、タッチが1つしかない場合は、それを処理します。それ以外の場合は渡します。例touchesMoved:
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
if ((touches.count == 1) && ([event allTouches].count == 1)) {
// handle single finger touch moves here
....
} else {
// If more than one touch, pass it along
[super touchesBegan:touches withEvent:event];
}
}