我使用下面的代码在 pdfpage 上画了一条线。当用户拖动注释时,有什么方法可以像橡皮擦一样擦除注释。
let lineAttributes: [PDFAnnotationKey: Any] = [ .linePoints: [startPoint.x, startPoint.y, point.x, point.y],
.lineEndingStyles: [PDFAnnotationLineEndingStyle.none,PDFAnnotationLineEndingStyle.none], .color: UIColor.red,.border: PDFBorder() ]
let lineAnnotation = PDFAnnotation(bounds: pageBounds , forType: .line,withProperties: lineAttributes)
lineAnnotation.border = border
lineAnnotation.color = selectedcolor
page!.addAnnotation(lineAnnotation)