I have been assigned a task in which I was supposed to draw some images and some straight lines in between those images. I did it successfully by using this method,
class PDFImageAnnotation: PDFAnnotation {
var image: UIImage?
convenience init(_ image: UIImage?, bounds: CGRect, properties: [AnyHashable : Any]?) {
self.init(bounds: bounds, forType: PDFAnnotationSubtype.ink, withProperties: properties)
self.image = image
}
override func draw(with box: PDFDisplayBox, in context: CGContext) {
super.draw(with: box, in: context)
// Drawing the image within the annotation's bounds.
guard let cgImage = image?.cgImage else { return }
context.draw(cgImage, in: bounds)
}
}
Now, whenever user taps on PDF page, I just add this image annotation at that location. After release of iOS 13 whenever I am tapping on PDF page, this is not showing image annotation, although I receive the touch delegates and my code is working fine on iOS 12. Any possible solution?