XcodesOrg / XcodesApp

The easiest way to install and switch between multiple versions of Xcode - with a mouse click.
MIT License
6.62k stars 291 forks source link

Resolve concurrency check warning on Swift 5.10 #522

Closed LiYanan2004 closed 1 month ago

LiYanan2004 commented 4 months ago

Swift 5.10 introduces stricter concurrency check which adds one more warning Reference to captured var 'progress' in concurrently-executing code; this is an error in Swift 6.

Because progress update is based on Notification and operates on OperationQueue.main, so we don't need to worry about data races.

So I opt-out concurrency check here by using nonisolated(unsafe)

MattKiazyk commented 3 months ago

@LiYanan2004 can you clean up this PR so it just includes the concurrency check since the other change was already merged in via https://github.com/XcodesOrg/XcodesApp/pull/521

LiYanan2004 commented 3 months ago

@MattKiazyk Hi, thanks for mentioning this. It's my fault. I have cleaned the PR to only contains swift-5.10 concurrency fix.