CollectionThing
CollectionThing copied to clipboard
Modifying state during view update, this will cause undefined behavior.
I got this runtime warning while running the code. I got this for one of my other preference changes. The only way I could get rid of this warning was to to add a DisapatchQueue.main.async which I know you don't want to do.
It seems to occur whenever the view changes because of an observed object changing. I haven't tried to reproduce this yet.
Try with: DispatchQueue.main.async { // code to execute }
Yep, that's what I'm doing in my code base. It's just that @liscio seemed to want to avoid using any dispatches (No weird uses of DispatchQueue.async - README)