twostraws / ControlRoom

A macOS app to control the Xcode Simulator.
MIT License
5.71k stars 306 forks source link

Fix: Task Wrapper for Actor-Isolated Method in ColorsView #173

Closed yotzincastrejon closed 9 months ago

yotzincastrejon commented 9 months ago

Description:

This PR resolves a runtime error in ColorsView due to calling the actor-isolated method assetCatalogData(for:) synchronously in a nonisolated context by wrapping it inside a Task initializer.

Changes:

Task {
    let catalogData = assetCatalogData(for: color)
    provider.register(catalogData)
}

Testing:

Tested on macOS 13.5.2 (22G91) and Xcode 15.0 (15A240d), with no new SwiftLint warnings or errors.

twostraws commented 9 months ago

Thank you!