Closed dsalber closed 3 years ago
The same is in my project :(
I see the same behavior in my project.
This is related to this: https://github.com/sunshinejr/SwiftyUserDefaults/issues/241
Same here
same here
Hey all. I just released 5.2.0 with the fix for that. Let me know if this helps - thanks!
I have a preference which uses another preference as its default value, something like:
var preference1: DefaultsKey { .init("preference1", defaultValue: 1) }
var preference2: DefaultsKey { .init("preference2", defaultValue: Defaults.preference1) }
When I set preference2, I crash with "Simultaneous accesses to 0x..., but modification requires exclusive access". For instance: Defaults.preference2 = 10 // crashes
Demo project showing the problem attached. Just run it and it should crash.
SwiftyRedux.zip