Fix potential races with SwiftUI and custom `objectWillChange`
Open
interface
- Dominant language
- Swift
- Stars
- 35.5k
- Forks
- 1.8k
- Avg merge
- 5d 5h
- Merged PRs (30d)
- 7
Description
In our Swift extensions to UTMQemuConfiguration and UTMViewState, we use
```swift
func propertyWillChange() -> Void {
if #available(iOS 13, macOS 11, *) {
DispatchQueue.main.async { self.objectWillChange.send() }
}
}
```
To interact with SwiftUI. This `async` silences warnings about modifying a value outside of the main thread but does not solve any race that could result from it. For now, it "just works" but it could lead to more subtle UI bugs.
Contributor guide
Assessment
This issue has not been assessed yet.