Color Picker does not notify delegate when dismissed by tapping outside the view on iPad
Originator: | ben.packard | ||
Number: | rdar://FB7777556 | Date Originated: | 6/24/2020 |
Status: | Open | Resolved: | |
Product: | iOS | Product Version: | 14 |
Classification: | UIKit | Reproducible: | Yes |
1. Create a `UIColorPickerViewController` and set its delegate. 2. Open the color picker on an iPad. 3. Tap outside the color picker's view. Expected behavior: - The color picker is dismissed - The delegate receives a `colorPickerViewControllerDidFinish` message Actual behavior: - The color picker is dismissed - The delegate does not receive a `colorPickerViewControllerDidFinish` message Comments It is useful to be able to update application state when the user has finished picking a color, even if the color change is being monitored via `colorPickerViewControllerDidSelectColor`. For example, we don't want to save a user's color selection hundreds of times as they drag their finger around the 'Spectrum' view, so we should wait until the user has finished with the color picker. But on iPad, the color picker can be dismissed without using the 'close' button by tapping out side its view. The other interpretation is that a tap outside the view is considered a 'cancel'. This seems unlikely since the color picker offers no such cancel action on iPhone (or more precisely, when the horizontal size class is compact). And if this the intention, `colorPickerViewControllerDidCancel` should be provided.
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!
Response
Apple
Jul 5, 2020 at 3:20 AM
After reviewing your feedback, we have some additional information for you:
This is expected behavior.
colorPickerViewControllerDidFinish
is only called when the dismissal originates from the color picker. That’s when the user taps the close button. The dismissal here is started by the presentation controller. There’s a separate delegate for the presentation controller which clients can set up.