I think what Apple would tell you to do would be to use the class-based Model like you gave in your example and rather than passing the model to your AppCommands, you would pass the playing property directly like: .focusedValue(\.playing, $model.playing) and your binding would become @FocusedBinding(\.playing) var playing: Bool?.
That being said, I think this solution is less than ideal and Apple should add a FocusedObject or similar property. Having to pass these properties directly involves a lot of code duplication and reduces functionality. Your example is straightforward, but in a more complex case Model may wish to react to, intercept, or otherwise want to capture the value change directly and doing it this way makes that much harder.
Post
Replies
Boosts
Views
Activity
We are also seeing this crash exclusively on iOS 16.0 up through iOS 16.1 (latest at time of this comment), starting from when the iOS 16 beta was released. Has anyone found any reproduction steps or work arounds? We are using a base AVPlayer instance, not AVQueuePlayer, in our app.
I'm also seeing this issue on the same OS versions and devices. I think the bug may be that TaskGroups aren't properly inheriting the execution context of their parent tasks. For example, in:
Task { @MainActor in
await withTaskGroup(of: Void.self) { taskGroup in
taskGroup.addTask {
foo()
}
bar()
}
}
I'd expect foo() and bar() to run on @MainActor since the task is run there, but it seems that on these specific OS versions that's not always the case.
Issue still exists on Beta 8
I also ran into an (a crash in our case) when accessing ASIdentifierManager off the main thread; I suspect it has an undocumented main thread requirement. Reported to apple: FB14569567