Forráskód Böngészése

进度变化切换到主线程

harry 3 éve
szülő
commit
0cd3c66541
1 módosított fájl, 4 hozzáadás és 2 törlés
  1. 4 2
      Introduce/Record/INVideoExportController.swift

+ 4 - 2
Introduce/Record/INVideoExportController.swift

@@ -63,8 +63,10 @@ class INVideoExportController: BFBaseViewController {
         let export = BFRecordExport()
         
         export.progress = {[weak self] progress in
-            self?.progressView.frame = CGRect(x: 0, y: self?.navHeadImageView?.bottomY ?? 0, width: (cScreenWidth) * CGFloat(progress), height: 10)
-            self?.progressL.text = String(format: "%d%%", Int(progress*100))
+            DispatchQueue.main.async { [weak self] in
+                self?.progressView.frame = CGRect(x: 0, y: self?.navHeadImageView?.bottomY ?? 0, width: (cScreenWidth) * CGFloat(progress), height: 10)
+                self?.progressL.text = String(format: "%d%%", Int(progress*100))
+            }
         }
         export.exportCompletion = {[weak self] (error, url) in
             guard let strongSelf = self else {