PDFSelectionSample
This is the project for Apple engineers debugging PDFKit selection
Steps to reproduce
-
Double click any word, a selection would be made around the word
-
Click the textbox at the top of the interface
-
Double click any word again, no selection could be found, but in the console, selection still made and printed.
Code Explanation
-
PDFKit view is a wrapper of PDFView
-
IvyPDF View is PDFView Extension, which adds LongPress Selection and Double Tap Selection.
-
Double Tap is to select an word automatically on which user double taps.
-
panSelection is to select words on which fingers press. It’s similar to PDFKit default long press, though it ends at the exact point where users lift their fingers.
-
Two closures provided to log pdfview and selection in the console so when selection is not visible but could still be found what is happening.