1 Reply
      Latest reply on Aug 7, 2019 5:55 AM by Qingpu
      doctorwizard Level 1 Level 1 (0 points)

        Adding a single tap gesture to a PDFView doesn't work correctly. Code is not executed when tapping on the document in the PDFView:

         

        In viewDidLoad() ->

        //single tap gesture

        let singleTap = UITapGestureRecognizer(target: self, action: #selector(singleTapped))

        singleTap.numberOfTapsRequired = 1

        pdfView.addGestureRecognizer(singleTap)

         

        func singleTapped() {

        //code to be executed_

        }

         

        Note though that if one taps on the light gray border around the document in the PDF view, the single tap code is executed.  It‘s just that the single tap code isn’t executed when tapping on the document in the PDF view.  This is still the case in iPadOS 13 beta 4.  Note that the single tap gesture and the same code worked perfectly in iOS 12 when tapping on the document in the PDF view.

         

        This clearly appears to be a bug and I have filed a feedback/bug report with Apple.