marinofaggiana 5 years ago
parent
commit
42f134d2bf
1 changed files with 2 additions and 5 deletions
  1. 2 5
      iOSClient/Viewer/NCViewerPDF.swift

+ 2 - 5
iOSClient/Viewer/NCViewerPDF.swift

@@ -75,13 +75,10 @@ import PDFKit
         pdfThumbnailView!.trailingAnchor.constraint(equalTo: detailViewController.backgroundView.safeAreaLayoutGuide.trailingAnchor).isActive = true
         pdfThumbnailView!.bottomAnchor.constraint(equalTo: detailViewController.backgroundView.safeAreaLayoutGuide.bottomAnchor).isActive = true
         
+        self.documentView?.gestureRecognizers?.removeAll()
         let tapGesture = UITapGestureRecognizer(target: self, action: #selector(didTap(_:)))
         tapGesture.numberOfTapsRequired = 1
-        
-        if var recognizer = self.gestureRecognizers {
-            recognizer.append(tapGesture)
-            self.gestureRecognizers = recognizer
-        }
+        detailViewController.backgroundView.addGestureRecognizer(tapGesture)
     }
     
     @objc func didTap(_ recognizer: UITapGestureRecognizer) {