ios 16 PDFView UIEditMenuInteraction bug

In my app I have custom menu for PDFView. It was implemented using UIMenuController but stopped work in ios16. The reason is that is now deprecated in ios16 and we should use UIEditMenuInteraction. Problem is for some reason ios call dismiss on my menu created by UIEditMenuInteraction (see it in willDimissMenu delegate) and shows default menu.

I try to workaround it displaying my custom view catching willDismissMenu but cant hide default menu (UIMenuController.shared.hideMenu() deprecated and doesnt work). I think its bug with implementation of UIEditMenuInteraction and PDFView. Any ideas how to workaround this ?

Hi sncvsrtoip,

Can you help me out with this? [https://developer.apple.com/forums/thread/720972]

Your quick help would be appreciated.

Thanks

sanketptl you have to imlement UIEditMenuInteraction, add pdfView.addInteraction(editMenuInteraction) and for example show menu on UILongPressGestureRecognizer at state .began or end tough as I wrote in this topic, there is problem that both your and default menu will be display.

ios 16 PDFView UIEditMenuInteraction bug
 
 
Q