Skip to content

Commit

Permalink
fix(swift5): example: dispatch call to main thread
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaultBee authored Nov 21, 2023
1 parent 0b939f1 commit 77dd658
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Example/Example/MainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)")
Expand Down

0 comments on commit 77dd658

Please sign in to comment.