每次我的整个代码都在工作时,我只得到这 3 个选项,我们将不胜感激。
let selections = pdfView.currentSelection?.selectionsByLine()
guard (selections?.first?.pages.first) != nil else { return }
selections?.forEach({ selection in
let newAnnotation = PDFAnnotation(bounds: selection.bounds(for: pdfView.currentPage!) ,forType: PDFAnnotationSubtype.highlight ,withProperties: nil)
// Add additional properties to the annotation
newAnnotation.color = #colorLiteral(red: 0.9254902005, green: 0.2352941185, blue: 0.1019607857, alpha: 1)
self.pdfView.currentPage?.displaysAnnotations = true
self.pdfView.currentPage?.addAnnotation(newAnnotation)
})