From 77dd65831d7dba5ed0cfb066cf7e8cb4e0f21486 Mon Sep 17 00:00:00 2001 From: ThibaultBee Date: Tue, 21 Nov 2023 10:08:38 +0000 Subject: [PATCH] fix(swift5): example: dispatch call to main thread --- Example/Example/MainViewController.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Example/Example/MainViewController.swift b/Example/Example/MainViewController.swift index a0f582c..e1d3bd6 100644 --- a/Example/Example/MainViewController.swift +++ b/Example/Example/MainViewController.swift @@ -123,7 +123,9 @@ class MainViewController: UIViewController { do { return try await self.upload(fileUrl: videoUrl, progress: { progress in print("Progress: \(progress.fractionCompleted)") - self.progressView.progress = Float(progress.fractionCompleted) + DispatchQueue.main.async { + self.progressView.progress = Float(progress.fractionCompleted) + } }) } catch { print("Upload error: \(error)")