The problem is that someone can mutate a1 before, and during the tasks runtime. One way to fix this is to make ContentView run all its accesses on the main thread by making it a @MainActor like so:
@MainActor
struct ContentView: View {
If having all interactions run on the main thread is not ideal you could also make ContentView an actor like so:
actor ContentView: View {
...
nonisolated var body: some View {
The nonisolated tells the compiler to not implicitly make it isolated, which would make that function no longer able to comply with the protocol View. For a Swift View id recommend going the @MainActor annotation.
Post
Replies
Boosts
Views
Activity
You can change the build config in your scheme target to release and get behavior that should match test-flight in most cases.
I found that the reason mine was not working was the entitlements were not the same across debug and release and snapshots were actually crashing.
https://developer.apple.com/library/archive/documentation/ToolsLanguages/Conceptual/Xcode_Overview/ManagingSchemes.html
I am having the same problem, but It can happen on my phone if if I build for release instead of debug as well. Maybe this will help someone figure out the solution?
I have since linked it to only Mobile Me type tasks, but no luck in reproducing it since I cannot create Mobile Me tasks.
I would also like to know a solution for this.