瀏覽代碼

fix progress counter

Marino Faggiana 7 年之前
父節點
當前提交
e5eb1ce3a0
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      Picker/DocumentPickerViewController.swift

+ 6 - 1
Picker/DocumentPickerViewController.swift

@@ -176,6 +176,8 @@ class DocumentPickerViewController: UIDocumentPickerExtensionViewController, CCN
             encryptedButton.tintColor = UIColor.clear
         }
         
+        NotificationCenter.default.addObserver(self, selector: #selector(triggerProgressTask(_:)), name: NSNotification.Name(rawValue: "NotificationProgressTask"), object: nil)
+        
         readFolder()
     }
     
@@ -397,7 +399,10 @@ class DocumentPickerViewController: UIDocumentPickerExtensionViewController, CCN
 
     //  MARK: - Download / Upload
     
-    func progressTask(_ fileID: String!, serverUrl: String!, cryptated: Bool, progress: Float) {
+    func triggerProgressTask(_ notification: NSNotification) {
+        
+        let dict = notification.userInfo
+        let progress = dict?["progress"] as! Float
         
         hud.progress(progress)
     }