tldr; I have tried to document the rules myself, and would appreciate feedback:
https://blog.hobbyistsoftware.com/2022/11/mainactor-the-rules/
I have been banging on for a while about how Apple/Swift should document what @MainActor actually does.
This has bubbled up in a separate discussion about warnings when @MainActor rules are broken
Which in turn reference some blog posts I have written on the subject.
https://blog.hobbyistsoftware.com/2022/11/five-ways-to-break-swift-concurrency/
https://blog.hobbyistsoftware.com/2022/01/mainactor-not-guaranteed/
Given that there is not currently any documentation that I'm aware of - I have had a go at writing 'the rules'
Specifically, I'm trying to document what is considered @MainActor, and when those rules are ignored.
https://blog.hobbyistsoftware.com/2022/11/mainactor-the-rules/
I'd appreciate any feedback - as I suspect I have missed some edge cases...