Skip to content

Commit

Permalink
Merge pull request #71 from apivideo/bugfix/swift5_sample_progress
Browse files Browse the repository at this point in the history
fix(swift5): example: dispatch call to main thread
  • Loading branch information
bot-api-video authored Nov 21, 2023
2 parents 0b939f1 + 77dd658 commit c5f7a8a
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 c5f7a8a

Please sign in to comment.