瀏覽代碼

fix tip

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 年之前
父節點
當前提交
ca53ba058b
共有 1 個文件被更改,包括 18 次插入1 次删除
  1. 18 1
      iOSClient/ScanDocument/NCScan.swift

+ 18 - 1
iOSClient/ScanDocument/NCScan.swift

@@ -117,12 +117,29 @@ class NCScan: UIViewController, NCScanCellCellDelegate {
     override func viewDidAppear(_ animated: Bool) {
         super.viewDidAppear(animated)
 
-        // TIP
+        showTip()
+    }
+
+    override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
+        super.viewWillTransition(to: size, with: coordinator)
+
+        self.tipView?.dismiss()
+        coordinator.animate(alongsideTransition: nil) { _ in
+            self.showTip()
+        }
+    }
+
+    // MARK: - Tip
+
+    func showTip() {
+
         if !NCManageDatabase.shared.tipExists(NCGlobal.shared.tipNCScanAddImage) {
             self.tipView?.show(forView: add, withinSuperview: self.view)
         }
     }
 
+    // MARK: -
+
     override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
         super.traitCollectionDidChange(previousTraitCollection)