-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Replace UITextInteraction API with UITextItem ones #24872
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: trunk
Are you sure you want to change the base?
Conversation
Generated by 🚫 Danger |
|
App Name | WordPress | |
Configuration | Release-Alpha | |
Build Number | 29140 | |
Version | PR #24872 | |
Bundle ID | org.wordpress.alpha | |
Commit | 24f497d | |
Installation URL | 24j06f51nbiqg |
|
App Name | Jetpack | |
Configuration | Release-Alpha | |
Build Number | 29140 | |
Version | PR #24872 | |
Bundle ID | com.jetpack.alpha | |
Commit | 24f497d | |
Installation URL | 6ekfrubh5ld1o |
2233d00
to
24f497d
Compare
|
I ran out of time today – I'll review and test it tomorrow morning.
It would be nice to remove the now redundant code under |
Good call. I'll do that. |
} | ||
|
||
func textView(_ textView: UITextView, menuConfigurationFor textItem: UITextItem, defaultMenu: UIMenu) -> UITextItem.MenuConfiguration? { | ||
if case .link = textItem.content { |
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.
Were you able to get these menus to work? I'm long-pressing on the links in notifications, and func textView(_ textView: UITextView, menuConfigurationFor textItem: UITextItem, defaultMenu: UIMenu) -> UITextItem.MenuConfiguration? {
doesn't seem to be called, and it shows the standard menu instead of the URL-related menu. I'm not sure if it's a regression from the PR or something else.
Screen.Recording.2025-09-23.at.3.20.33.PM.mov
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.
The trunk branch also behaves like that. The original deprecated function is also not called when long-pressing on links. I think that may have something to do with the RichTextView
type.
Let's merge this targeting 26.5, reducing the affected areas for 26.4. |
Note
This PR is built on top of #24871, and will be merged after that.
Description
My understanding is that the delegate function that uses
UITextItemInteraction
was split into two methods: theprimaryActionFor
one and themenuConfigurationFor
one.We need to return a
UIAction
in theprimaryActionFor
delegate method. And, where the original function returns false, we now need to return nil in themenuConfigurationFor
delegate method.Testing instructions