MenuSupport icon indicating copy to clipboard operation
MenuSupport copied to clipboard

Could not get selected text on PDF.

Open r-plus opened this issue 5 years ago • 1 comments

PDF loaded WKWebView return _UISizeTrackingView instance via _currentContentView method that have not selectedText method. Actual pdf view is running on separated process as com.apple.PDFKit.PDFExtensionView. Currently i'm not sure how to get selected text on that situation.

https://github.com/r-plus/MenuSupport/blob/master/Tweak.xm#L219

at least iOS 12+


these copy: method will use when user did copy. Probably view controller execute one way IPC to pdf process to copy.

-[PDFHostViewController copy:]
-[PDFView copy:]

r-plus avatar Jul 24 '20 10:07 r-plus

If we call copy: in Invoke, then arg of didCopyString: will be the selected string but this method will not be executed until Invoke finished...

brendonjkding avatar Dec 29 '20 10:12 brendonjkding