Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/ios.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'iOSClient/Viewer/NCViewerPDF/NCViewerPDF.swift')
-rw-r--r--iOSClient/Viewer/NCViewerPDF/NCViewerPDF.swift27
1 files changed, 18 insertions, 9 deletions
diff --git a/iOSClient/Viewer/NCViewerPDF/NCViewerPDF.swift b/iOSClient/Viewer/NCViewerPDF/NCViewerPDF.swift
index 3e77c598f..c7d4d4cd3 100644
--- a/iOSClient/Viewer/NCViewerPDF/NCViewerPDF.swift
+++ b/iOSClient/Viewer/NCViewerPDF/NCViewerPDF.swift
@@ -25,7 +25,7 @@ import UIKit
import PDFKit
import EasyTipView
-class NCViewerPDF: UIViewController, NCViewerPDFSearchDelegate, UIGestureRecognizerDelegate {
+class NCViewerPDF: UIViewController, NCViewerPDFSearchDelegate {
var metadata = tableMetadata()
var imageIcon: UIImage?
@@ -63,7 +63,11 @@ class NCViewerPDF: UIViewController, NCViewerPDFSearchDelegate, UIGestureRecogni
filePath = CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView)!
pdfDocument = PDFDocument(url: URL(fileURLWithPath: filePath))
let pageCount = CGFloat(pdfDocument?.pageCount ?? 0)
- defaultBackgroundColor = pdfView.backgroundColor
+ if #available(iOS 13.0, *) {
+ defaultBackgroundColor = pdfView.backgroundColor
+ } else {
+ defaultBackgroundColor = .lightGray
+ }
view.backgroundColor = defaultBackgroundColor
navigationItem.rightBarButtonItem = UIBarButtonItem(image: UIImage(named: "more")!.image(color: NCBrandColor.shared.label, size: 25), style: .plain, target: self, action: #selector(self.openMenuMore))
@@ -170,19 +174,17 @@ class NCViewerPDF: UIViewController, NCViewerPDFSearchDelegate, UIGestureRecogni
let swipePdfView = UISwipeGestureRecognizer(target: self, action: #selector(gestureClosePdfThumbnail))
swipePdfView.direction = .right
+ swipePdfView.delegate = self
pdfView.addGestureRecognizer(swipePdfView)
- let swipePdfThumbnailScrollView = UISwipeGestureRecognizer(target: self, action: #selector(gestureClosePdfThumbnail))
- swipePdfThumbnailScrollView.direction = .right
- pdfThumbnailScrollView.addGestureRecognizer(swipePdfThumbnailScrollView)
-
let edgePdfView = UIScreenEdgePanGestureRecognizer(target: self, action: #selector(gestureOpenPdfThumbnail))
edgePdfView.edges = .right
+ edgePdfView.delegate = self
pdfView.addGestureRecognizer(edgePdfView)
- let edgeView = UIScreenEdgePanGestureRecognizer(target: self, action: #selector(gestureOpenPdfThumbnail))
- edgeView.edges = .right
- view.addGestureRecognizer(edgeView)
+ let swipePdfThumbnailScrollView = UISwipeGestureRecognizer(target: self, action: #selector(gestureClosePdfThumbnail))
+ swipePdfThumbnailScrollView.direction = .right
+ pdfThumbnailScrollView.addGestureRecognizer(swipePdfThumbnailScrollView)
NotificationCenter.default.addObserver(self, selector: #selector(favoriteFile(_:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterFavoriteFile), object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(deleteFile(_:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterDeleteFile), object: nil)
@@ -497,6 +499,13 @@ class NCViewerPDF: UIViewController, NCViewerPDFSearchDelegate, UIGestureRecogni
}
}
+extension NCViewerPDF: UIGestureRecognizerDelegate {
+
+ func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
+ return true
+ }
+}
+
extension NCViewerPDF: EasyTipViewDelegate {
func easyTipViewDidTap(_ tipView: EasyTipView) {