iOS 13.2.3 pdfViewGestureRecognize and PDFkit

136 Views Asked by At

Here is my Code it work perfectly in iOS 12 but for iOS 13 code can't give exactly values

let pdfViewGestureRecognizer = PDFViewGestureRecognizer()

 pdfView.autoScales = true
        pdfView.displayMode = .singlePage
        pdfView.displayDirection = .horizontal
        pdfView.usePageViewController(true, withViewOptions: [UIPageViewControllerOptionInterPageSpacingKey: 20])

        pdfView.addGestureRecognizer(pdfViewGestureRecognizer)

        pdfView.document = pdfDocument

here is first problem is not go here I adding great delegate for Gesture and other details find here but isn't work too !! isn't go to func touchesBegan and is not go to if (String(describing: subVws).range(of:"UIView") != nil)

class PDFViewGestureRecognizer: UIGestureRecognizer {
    var isTracking = false

override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent) {
    isTracking = true
    print ("but not iOS 13.2.3")


}
override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent) {
    isTracking = false


}

override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent) {
    isTracking = false
}

}

here is second part

        let pdfSubVws = pdfView.subviews
        print("subVws  ",pdfSubVws)

        for subVws in pdfSubVws
        {
            if (String(describing: subVws).range(of:"UIPageViewControllerContentView") != nil)
            {
                let pageVc = subVws.subviews

                for subVws in pageVc
                {
                    if (String(describing: subVws).range(of:"UIQueuingScrollView") != nil)
                    {
                        let QueueVc = subVws.subviews
//                        print("QueueVcQueueVc  ", QueueVc)
                        for subVws in QueueVc
                        {
                            if (String(describing: subVws).range(of:"UIView") != nil)
                            {
                                let viewVc = subVws.subviews
//                                print("\n\nviewVcVcQueueVc  ", viewVc)

                                for subVws in viewVc
                                {
                                    if (String(describing: subVws).range(of:"UIView") != nil)
                                    {

                                        let SubviewVc = subVws.subviews
//                                        print("\n\nSubviewVcSubviewVc  ", SubviewVc)

                                        for subVws in SubviewVc
                                        {
                                            if (String(describing: subVws).range(of:"UIScrollView") != nil)
                                            {
                                                let finalVw = subVws.subviews
//                                                print("\n\nfinalVw  ", finalVw)
//
                                                for subVws in finalVw
                                                {
                                                    if (String(describing: subVws).range(of:"UIView") != nil)   //here is  ok iOS 12 It's ok  but not iOS 13.2.3
                                                    {
0

There are 0 best solutions below