我正在尝试使用以下代码在PDF页面上添加注释(气泡文本)注释,但它对我不起作用。
let rect = CGRect.init(x: 300, y: 300, width: 50, height: 50)
let ann = PDFAnnotation.init(bounds: rect, forType: .text, withProperties: nil)
ann.iconType = .note
ann.caption = "Test Comments"
self.currentPage?.addAnnotation(selectedAnnotation!)
我也尝试在各种博客上找到解决方案,但那里的信息很少。
任何人都可以建议上面的代码有什么问题。