A SwiftUI View, ObservableObject, or @-Observable, should have either an @-MainActor or a detailed doc comment explaining exactly why @-MainActor isn't required. These are the only acceptable states. We need to all get really used to this, because wow, the bugs I am seeing 😵
@mattiem I feel this. My day-job’s codebase is littered with non-MainActor ObservableObjects.
@jonduenas I guess it *could* be ok if you never use concurrency...
@mattiem It’s a mess of completion handlers and DispatchQueues and async/await… soooooooo 😅
@jonduenas welp in that case better start slapping MainActor everywhere 🫠
@mattiem Is there a way you recommend to enforce this automatically or to set it globally? Or do I have to set it manually whenever I create a View/ObservableObject? (I see SwiftLint has an unmerged PR for ObservableObject.)
@zachahn I guess you could make variants like MainActorView to try to help a little, but aside from SwiftUI making changes I don't think so 😥
@mattiem Good to know, thank you! I'll try defining that. Maybe I'll put together a quick script that looks for "import SwiftUI" but doesn't have a "MainActorView" or something!

@zachahn @mattiem I guess you can’t just write

@MainActor
extension View {}

Can you? 😂

@JetForMe @zachahn actually....

I *think* this could work!