tonyarnold,
@tonyarnold@mastodon.social avatar

The interactions between SwiftUI, SwiftData and Swift Concurrency can be confusing.

Because SwiftData Models are retrieved by Views on the MainActor, it's reasonably safe to pass them between Views, but anything around the edges will still force you to drop back to persistent identifiers and looking up the Models — it'd almost be easier to pretend that it's not safe to pass Models between Views, for consistency.

bazscott,
@bazscott@mastodon.social avatar

@tonyarnold I installed Sentry recently on a brand new iOS 17 app we're building with SwiftData. It's a standard architecture, no ViewModels, all simple and as Apple recommends kinda thing. Sentry spotted a few places were DB actions were performed off the main thread. (Was impressive actually.)

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