Parcourir la source

Imroved code

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana il y a 1 an
Parent
commit
d4a6b6b9b4
1 fichiers modifiés avec 2 ajouts et 8 suppressions
  1. 2 8
      iOSClient/Viewer/NCViewerPDF/NCViewerPDF.swift

+ 2 - 8
iOSClient/Viewer/NCViewerPDF/NCViewerPDF.swift

@@ -418,19 +418,13 @@ class NCViewerPDF: UIViewController, NCViewerPDFSearchDelegate {
     @objc func tapPdfView(_ recognizer: UITapGestureRecognizer) {
 
         if pdfThumbnailScrollView.isHidden {
-            if navigationController?.isNavigationBarHidden ?? false {
-                navigationController?.setNavigationBarHidden(false, animated: true)
-            } else {
-                navigationController?.setNavigationBarHidden(true, animated: true)
-            }
-        }
 
-        UIView.animate(withDuration: animateDuration) {
             self.pdfContainerTopAnchor?.isActive = false
-        } completion: { _ in
             if let barHidden = self.navigationController?.isNavigationBarHidden, barHidden {
+                navigationController?.setNavigationBarHidden(false, animated: true)
                 self.pdfContainerTopAnchor = self.pdfContainer.topAnchor.constraint(equalTo: self.view.topAnchor)
             } else {
+                navigationController?.setNavigationBarHidden(true, animated: true)
                 self.pdfContainerTopAnchor = self.pdfContainer.topAnchor.constraint(equalTo: self.view.safeAreaLayoutGuide.topAnchor)
             }
             self.pdfContainerTopAnchor?.isActive = true