Product:
iOS PdfTron SDK
Product Version:
Please give a brief summary of your issue:
I have added an image(A) in my PDF file. However, when I click on image A to add an image to overwrite image A, the delegate I receive is as follows
I have added an image(A) in my PDF file. However, when I click on image A to add an image to overwrite image A, the delegate I receive is as follows
override func pdfViewCtrl(_ pdfViewCtrl: PTPDFViewCtrl, onTouchesCancelled touches: Set, with event: UIEvent?) → Bool {
I should have received the function call from
override func pdfViewCtrl(_ pdfViewCtrl: PTPDFViewCtrl, onTouchesEnded touches: Set, with event: UIEvent?) →
I don’t know why this error occurs.
Please describe your issue and provide steps to reproduce it:
class CustomImageTool: CustomToolBase {
private var startPosition: PTPDFPoint!
private var readyFirstPosition: Bool = false
private var clickPoint: PTPDFPoint? = nil
private var imageGeometry: PTAnnot!
private var uuid: String = ""
private let DIVIDE_BY: Double = 8
required init(pdfViewCtrl: PTPDFViewCtrl) {
super.init(pdfViewCtrl: pdfViewCtrl)
}
override class var createsAnnotation: Bool {
return true
}
override var annotClass: AnyClass {
return CustomImageTool.self
}
override var annotType: PTExtendedAnnotType {
return .imageStamp
}
override func getToolType() -> CustomToolType {
return CustomToolType.image
}
override var allowScrolling: Bool {
return false
}
override func pdfViewCtrl(_ pdfViewCtrl: PTPDFViewCtrl, handleTap gestureRecognizer: UITapGestureRecognizer) -> Bool {
return true
}
override func pdfViewCtrl(_ pdfViewCtrl: PTPDFViewCtrl, onTouchesBegan touches: Set<UITouch>, with event: UIEvent?) -> Bool {
let numberOfTouches = touches.count
return true
}
override func pdfViewCtrl(_ pdfViewCtrl: PTPDFViewCtrl, onTouchesMoved touches: Set<UITouch>, with event: UIEvent?) -> Bool {
return true
}
override func pdfViewCtrl(_ pdfViewCtrl: PTPDFViewCtrl, onTouchesEnded touches: Set<UITouch>, with event: UIEvent?) -> Bool {
// todo : add image
return true
}
override func pdfViewCtrl(_ pdfViewCtrl: PTPDFViewCtrl, onTouchesCancelled touches: Set<UITouch>, with event: UIEvent?) -> Bool {
// todo : canceled
return true
}
Please provide a link to a minimal sample where the issue is reproducible: