mattiem,
@mattiem@mastodon.social avatar

@donnywals hey Donny!

I just read your post here. I’m not sure using a runtime check (Thread.isMainThread) really makes sense here because isolation is determined at compile time. There is never ambiguity for correctly annotated APIs.

Though I do agree that SwiftUI marking its body as MainActor but not the entire type is a poor API that makes it specifically hard to use.

https://www.donnywals.com/how-to-determine-where-tasks-and-async-functions-run-in-swift/

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • DreamBathrooms
  • mdbf
  • osvaldo12
  • magazineikmin
  • GTA5RPClips
  • rosin
  • tester
  • Youngstown
  • Durango
  • slotface
  • everett
  • kavyap
  • InstantRegret
  • thenastyranch
  • JUstTest
  • ethstaker
  • modclub
  • cisconetworking
  • anitta
  • cubers
  • khanakhh
  • ngwrru68w68
  • tacticalgear
  • normalnudes
  • provamag3
  • Leos
  • megavids
  • lostlight
  • All magazines