ramzesenok,
@ramzesenok@mastodon.social avatar

This might sound trivial but I just figured it out and I’m so happy to have learned it!

If you’re using and and you don’t add/delete entries on a certain screen but rather just update the entries themselves – you don’t need to use @Query!

You can load the entries once using context.fetch() and then work with them. SwiftUI will automatically update views when you update the entries but without @Query it won’t make fetch requests EVERY TIME something changes

harrisonheinig,

@ramzesenok @Query thanks for sharing! I always felt like there had to be a better way but never found it.

ramzesenok,
@ramzesenok@mastodon.social avatar

@harrisonheinig @Query with just 1k entries I had so many hangs in the app but was able to fix all of them using this technique!

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