-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Integrate PHPickerViewController in Site Icon picker #21370
Conversation
📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
|
3a9cafc
to
0b1ef40
Compare
alert.addDestructiveActionWithTitle(SiteIconAlertStrings.Actions.removeSiteIcon) { [weak self] _ in | ||
NoticesDispatch.unlock() | ||
self?.removeSiteIcon() | ||
func didShowSiteIconMenu() { |
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.
There doesn't seem to be any good way to track UIMenu
dismiss event, so I implemented this "pull-based" check for the site icon flow termination. Not ideal, but works.
📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
|
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.
I tested all the cases, and it works as described! Left some comments
WordPress/Classes/ViewRelated/Blog/Blog Details/Detail Header/SiteIconView.swift
Outdated
Show resolved
Hide resolved
|
||
let delegate = ImagePickerDelegate(delegate: delegate) | ||
picker.delegate = delegate | ||
objc_setAssociatedObject(picker, &MediaPickerMenu.strongDelegateKey, delegate, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) |
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.
Q: are you doing this to ensure the picker / delegate gets deallocated along with the menu?
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.
I need to retain ImagePickerDelegate
that gets created by this method. It gets deallocated along with the image picker.
0b1ef40
to
1805a9f
Compare
…SiteIconView.swift Co-authored-by: Momo Ozawa <[email protected]>
016f000
to
5eccbcd
Compare
Part of #21190.
MediaPickerMenu
API for creating the media picker actions. It has a convenient API that ensures the actions are consistent across different parts of the app. The picker usesUIImageViewContoller
directly (instead ofWPMediaCapturePresenter
from WPMediaPicker) – moving forward with the WPMediaPicker removal.To test:
Important
Choose from Device (Happy Path)”
Choose from Device (Misc)”
Camera
QuickStart
Recordings: menu-cancelled.mp4, icon-updated.mp4.
Removing Icon
Misc
Options
Flag Disabled
Bonus Points
MediaPickerMenu
options (filter
andisMultipleSelectionEnabled
)MediaLibraryPickerDataSource
and pickers get deallocated after selection or cancellationRegression Notes
PR submission checklist:
RELEASE-NOTES.txt
if necessary.UI Changes testing checklist: