Custom webView menu

I want to delete some suggestedActions and add custom menu when select text in webView in iOS 16. How can I do it with UIEditMenuInteraction? Before I use canPerformAction + UIMenuController

I achieved the results I wanted for the time being through swizzle method 'UIEditMenuInteraction.initWithDelegate:'. Block the delegate method 'menuForConfiguration~suggestedActions' to invocation. It is not good. Hope wkwebview provide some official methods to custom menu sooner

Can you tell us how you did it? I have the same problem as you. Thank you

Hi, thank you for the swizzle solution! But for me "Block the delegate method 'menuForConfiguration~suggestedActions' to invocation." didn't work. It seems that WKWebView and UIWebView didn't call this delegate method. Can you show us some source code of how to achieve that? thanks a lot!

Custom webView menu
 
 
Q