Cannot get a correct buttonMask value from a UIGestureRecognizer instance

Originator:yinpengqi
Number:rdar://FB8470648 Date Originated:
Status:Open Resolved:
Product:iOS/UIKit Product Version:
Classification: Reproducible:YES
 
According to https://developer.apple.com/documentation/uikit/uigesturerecognizer/3538974-buttonmask?language=objc we can see that buttonMask is a new property added since ios 13.4.

However, during my development process, I found that I cannot get the correct value from a UIGestureRecognizer instance. It always equals to 0. Actually it should equals to 1 if current button is primary, 2 if secondary.

It is worth mentioning that we can get the correct value from its derived class like the following way,
```
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
   NSLog(@ā€œ%s event.buttonMask:%dā€, __func__, event.buttonMask);
}
```
Even so, we cannot access it from the base class instance, and 'buttonMask' is readonly, we cannot change its value.

If you think it is indeed a mistake, can you solve this problem? This will greatly help our development. Thank you very much!

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!