Singletons and Swift Concurrency? Why yes, I do have thoughts, thanks for asking!

https://www.massicotte.org/singletons

Singletons with Swift Concurrency

I see singletons used a lot in Swift projects. These things are, by definition, global state. That means they can be accessed from any context - any thread or actor - at any time. And this property makes them a common source of problems when used with Concurrency.

massicotte.org
@mattiem Thank you for this and all your other posts. The link to the Apple Singletons documentation doesn’t work for me.

@fossil12 Oh thank you!

And I appreciate the bug report so much. I pushed up a fix earlier, but it hasn’t deployed yet. Hopefully won’t take too much longer…