What really happens when call setCancelsTouchesInView?

后端 未结 2 1290
猫巷女王i
猫巷女王i 2020-12-29 11:41

Wondering what really happens when i call setCancelsTouchesInView. It is not covered in the official document http://developer.apple.com/library/ios/#documentation/uikit/ref

2条回答
  •  情书的邮戳
    2020-12-29 12:10

    From the apple developer portal link:

    cancelsTouchesInView — If a gesture recognizer recognizes its gesture, it unbinds the remaining touches of that gesture from their view (so the window won’t deliver them). The window cancels the previously delivered touches with a (touchesCancelled:withEvent:) message. If a gesture recognizer doesn’t recognize its gesture, the view receives all touches in the multi-touch sequence.

    cancelsTouchesInView:

    A Boolean value affecting whether touches are delivered to a view when a gesture is recognized.

    @property(nonatomic) BOOL cancelsTouchesInView

    Discussion

    When this property is YES (the default) and the receiver recognizes its gesture, the touches of that gesture that are pending are not delivered to the view and previously delivered touches are cancelled through a touchesCancelled:withEvent: message sent to the view. If a gesture recognizer doesn’t recognize its gesture or if the value of this property is NO, the view receives all touches in the multi-touch sequence.

提交回复
热议问题