Эх сурвалжийг харах

fix tip

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 жил өмнө
parent
commit
2349671607

+ 12 - 6
iOSClient/Viewer/NCViewerMedia/NCViewerMedia.swift

@@ -192,10 +192,7 @@ class NCViewerMedia: UIViewController {
             viewerMediaPage?.clearCommandCenter()
             viewerMediaPage?.clearCommandCenter()
         }
         }
 
 
-        // TIP
-        if !NCManageDatabase.shared.tipExists(NCGlobal.shared.tipNCViewerMediaDetailView), let view = self.navigationController?.navigationBar {
-            self.tipView?.show(forView: view)
-        }
+        showTip()
 
 
         NotificationCenter.default.addObserver(self, selector: #selector(openDetail(_:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterOpenMediaDetail), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(openDetail(_:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterOpenMediaDetail), object: nil)
     }
     }
@@ -210,7 +207,6 @@ class NCViewerMedia: UIViewController {
         super.viewWillTransition(to: size, with: coordinator)
         super.viewWillTransition(to: size, with: coordinator)
 
 
         self.tipView?.dismiss()
         self.tipView?.dismiss()
-
         coordinator.animate(alongsideTransition: { context in
         coordinator.animate(alongsideTransition: { context in
             // back to the original size
             // back to the original size
             self.scrollView.zoom(to: CGRect(x: 0, y: 0, width: self.scrollView.bounds.width, height: self.scrollView.bounds.height), animated: false)
             self.scrollView.zoom(to: CGRect(x: 0, y: 0, width: self.scrollView.bounds.width, height: self.scrollView.bounds.height), animated: false)
@@ -220,7 +216,17 @@ class NCViewerMedia: UIViewController {
                     self.openDetail()
                     self.openDetail()
                 }
                 }
             }
             }
-        }) { _ in }
+            self.showTip()
+        })
+    }
+
+    // MARK: - Tip
+
+    func showTip() {
+
+        if !NCManageDatabase.shared.tipExists(NCGlobal.shared.tipNCViewerMediaDetailView), let view = self.navigationController?.navigationBar {
+            self.tipView?.show(forView: view)
+        }
     }
     }
 
 
     // MARK: - Image
     // MARK: - Image