Hacker News new | ask | show | jobs
by Terretta 655 days ago
The couple comments and then paragraph about having to restart the simulator:

... restart the simulator every 3rd try or so. Because if you don’t the workout will still be running in the background and everything just silently fails and you will think you have a bug in your code until you finally find the correct stack overflow reference that just explains this is the way life is.

Doesn't seem to happen to me in the standalone simulator or on a connected device. For me it seems to happen in the Preview, which is not the same thing. It seems to start when you manage to get the main app and the preview version out of sync, usually during a code edit and preview refresh.

The problem seems to go away if you handle previews and preview provider concurrency more explicitly:

https://developer.apple.com/documentation/swiftui/previewpro...