-
-
Notifications
You must be signed in to change notification settings - Fork 372
feat(samples): Add button to display gallery picker #6924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
philipphofmann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| extension ExtraViewController: PHPickerViewControllerDelegate { | ||
| func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) { | ||
| // noop | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: PHPickerViewController is not dismissed in picker(_:didFinishPicking:), blocking user interaction.
Severity: CRITICAL | Confidence: High
🔍 Detailed Analysis
The PHPickerViewController presented by showGalleryUIAction(_:) is not dismissed after the user selects an image or cancels. The picker(_:didFinishPicking:) delegate method, which is required to dismiss the picker according to Apple's documentation, is implemented as a no-op, causing the picker to remain visible and block further app interaction.
💡 Suggested Fix
Add picker.dismiss(animated: true, completion: nil) inside the picker(_:didFinishPicking:) delegate method to properly dismiss the PHPickerViewController.
🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: Samples/iOS-Swift/iOS-Swift/ExtraViewController.swift#L435-L439
Potential issue: The `PHPickerViewController` presented by `showGalleryUIAction(_:)` is
not dismissed after the user selects an image or cancels. The
`picker(_:didFinishPicking:)` delegate method, which is required to dismiss the picker
according to Apple's documentation, is implemented as a no-op, causing the picker to
remain visible and block further app interaction.
Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 4210419
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds relevant
| <rect key="frame" x="0.0" y="0.0" width="320" height="411"/> | ||
| <subviews> | ||
| <stackView opaque="NO" contentMode="scaleToFill" distribution="fillProportionally" alignment="center" id="DsI-9S-jdi"> | ||
| <rect key="frame" x="0.0" y="0.0" width="320" height="190.5"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You changed the default device right? I think many of the changes here come from that
I used this sample to investigate #6104. I believe it is benefical to keep it around.
#skip-changelog
Closes #6925