开发者

How to enable multiple touches in an iOS app?

开发者 https://www.devze.com 2022-12-20 18:07 出处:网络
Here is the code: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { if ([touches count] == 1) {

Here is the code:

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
  if ([touches count] == 1) {
    // code
  } else {
    // code
  }
}

When I simulate the double tap with the Option key in simulator, the code always chooses 开发者_运维问答the first part of my if statement, as if there were only 1 touch received.

Why am I not receiving both touches?


The multipleTouchEnabled property needs to be set to YES before the view can accept multitouch.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号