Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifying state during view update, this will cause undefined behavior. #4

Open
plivesey opened this issue Nov 21, 2019 · 3 comments
Open

Comments

@plivesey
Copy link

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.

@plivesey
Copy link
Author

Screen Shot 2019-11-21 at 10 30 08 AM

@itrack
Copy link

itrack commented Feb 12, 2020

Try with:
DispatchQueue.main.async {
// code to execute
}

@plivesey
Copy link
Author

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants