UITapGestureRecognizer that is set on a UIPickerView ignores taps in iOS 7.1
| Originator: | billafonix | ||
| Number: | rdar://16312931 | Date Originated: | 3/13/2014 |
| Status: | Open | Resolved: | |
| Product: | iOS SDK | Product Version: | 7.1/11D167 |
| Classification: | Serious Bug | Reproducible: | Always |
Summary:
We have an app with a UIPickerView. To allow users more flexibility in choosing from the pickerView, we added a UITapGestureRecognizer to the UIPickerView, so that a user can scroll multiple times if needed, and then tap on the selection to confirm it before we take action on their selection. While this works in iOS 7.0.6 and below, the new release of iOS 7.1 no longer responds to the tapGestureRecognizer.
Steps to Reproduce:
1. Add a UITapGestureRecognizer to a UIPickerView:
-(void)setupTapGesture:(UIPickerView *)sender {
UITapGestureRecognizer *tapTest =[[UITapGestureRecognizer alloc] initWithTarget:self
action:@selector(pickerTap)];
[sender addGestureRecognizer:tapTest];
}
- (void)pickerTap {
NSLog(@"picker was tapped");
}
2. Run the app, change the selection in the pickerView, then tap the selection.
Expected Results:
The console will show "picker was tapped," indicating that the tapGestureRecognizer fired.
Actual Results:
Nothing happens, indicating that the tapGestureRecognizer did not fire.
Version:
iOS 7.1/11D167
Notes:
The workaround we've implemented at this point is to check for iOS 7.1, and manually fire the pickerTap method for those users; Users no longer get to choose an option and then confirm, but otherwise this works well enough. We keep the tapGestureRecognizer in place for all iOS versions <7.1.
Configuration:
This occurs in the Simulator running iOS 7.1, on an iPhone 5 running iOS 7.1, and on an iPhone 4S running iOS 7.1.
Attachments:
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!