Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何在PDFView中启用连续文本的选择,以便添加注释?_Ios_Objective C_Swift_Apple Pdfkit - Fatal编程技术网

Ios 如何在PDFView中启用连续文本的选择,以便添加注释?

Ios 如何在PDFView中启用连续文本的选择,以便添加注释?,ios,objective-c,swift,apple-pdfkit,Ios,Objective C,Swift,Apple Pdfkit,目前,我已经使用PDFDocument在PDFView上呈现了一个示例pdf文件 pdfView.autoScales = true pdfView.displayDirection = .horizontal pdfView.displayMode = .singlePage pdfView.usePageViewController(true, withViewOptions: [UIPageViewControllerOptionInterPageSpacingKey: 20]) pdfV

目前,我已经使用PDFDocument在PDFView上呈现了一个示例pdf文件

pdfView.autoScales = true
pdfView.displayDirection = .horizontal
pdfView.displayMode = .singlePage
pdfView.usePageViewController(true, withViewOptions: [UIPageViewControllerOptionInterPageSpacingKey: 20])
pdfView.document = pdfDocument
因此,当我在视图上滑动时,它会在我使用pageViewController时分别滑动到下一页或上一页

问题就出在这里,

如果我不想注释文本的某些部分,那么当我开始拖动文本时,它会滑到下一页,而不是连续选择文本

如果我长按,则我只能选择一个单词或本机操作系统选项,选择所有弹出窗口,这不是我的要求


当用户开始选择文本时,我需要添加突出显示的注释。

对于仍有上述问题的用户,解决方案只是一行

pdfView!.isUserInteractionEnabled = !pdfView.isUserInteractionEnabled
将禁用pdfview子视图的滚动

要启用向后滚动,只需使用上面提到的同一行即可