Replace UITextInteraction API with UITextItem ones#24872
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.
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.
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
UITextItemInteractionwas split into two methods: theprimaryActionForone and themenuConfigurationForone.We need to return a
UIActionin theprimaryActionFordelegate method. And, where the original function returns false, we now need to return nil in themenuConfigurationFordelegate method.Testing instructions