目前,我已经使用 PDFDocument 在 PDFView 上呈现了一个示例 pdf 文件。
pdfView.autoScales = true
pdfView.displayDirection = .horizontal
pdfView.displayMode = .singlePage
pdfView.usePageViewController(true, withViewOptions: [UIPageViewControllerOptionInterPageSpacingKey: 20])
pdfView.document = pdfDocument
因此,当我在视图上滑动时,它会在我使用 pageViewController 时分别滑到下一页或上一页。
问题就出现在这里,
如果我想注释文本的某些部分,那么当我开始拖动文本时,它会滑动到下一页而不是连续选择文本。
如果我长按,那么我只能选择一个单词或使用 Copy 选择本机操作系统,Selectall 会弹出,这不是我的要求。
当用户开始选择文本时,我需要添加高亮注释。