brandonhorst, to random
@brandonhorst@techhub.social avatar

SwiftData developer experience

@Observable: 🥰
@Model: 😎
: 🤮

alexkaessner, to random
@alexkaessner@mas.to avatar

Great, with the latest Beta 5 my Queries aren’t working anymore. I’m aware of the issue with the explicit model type information for filter: and sort: … fixed that already.

But why isn’t this simple Query with a not working anymore? Any tips?

helge, to random
@helge@mastodon.social avatar

Maybe it is just me, but I just don't find much "Swiftyness" in . In fact it doesn't feel Swifty at all to me. Well, maybe when that #Predicate with 3 expressions gets back to you with the "unable to resolve blub in time" 🙈
E.g. has gone (extraordinarily annoying) lengths at making sure that the initialization contract is ensured. No more "half initialized objects" anymore. And then we get this 🤷‍♀️

helge, to random
@helge@mastodon.social avatar

The new Foundation/ Predicates (and its expressions) seem a little weird because they can't be constructed dynamically?
E.g. if I build a app in which I'd let the user construct the query himself (similar to the Finder search), I'd have to hardcode every possible combination of search fields?
Did someone find a workaround for this?

json,

@helge @kharrison Haven’t tried it but if you generate a predicate for each case in your enum - then could you could loop over them and AND or OR them together like this?

var predicate = query.first.predicate
for subQuery in query.dropFirst {
predicate = { predicate && subQuery.predicate }
}

brandonhorst, to random
@brandonhorst@techhub.social avatar

So are Compound Predicates just not a thing with the new ? That makes them… pretty tough to work with for anything beyond example projects.

twostraws, to random
@twostraws@mastodon.social avatar

I just filed a whole bunch of feedback reports for Apple regarding SwiftData. If you see any of these and want the same, please file your own report asking for it – every feedback counts, particularly now as we're still in the early betas.

  • FB12416784: Please add compound predicate support with
  • FB12416816: Please expose NSMergePolicy for when SwiftData syncs with CloudKit
  • FB12416840: Please provide live query support with an equivalent of NSFetchedResultsController
StewartLynch, to random
@StewartLynch@iosdev.space avatar

Made great progress with my Wine app today converting to once I figured out how to create a to match criteria on related properties. Works really well. And easy to understand. I am back to loving SwiftData again.

marcel, to random
@marcel@mastodon.social avatar

I've been playing around with predicates for hours and I must be doing something very wrong. They work, but only for the most basic of stuff.

The first one works. The second one and other variants of it results in me getting back nothing.

marcel,
@marcel@mastodon.social avatar

Well, this explains it then.

"SwiftData queries don’t support some flatmap and nil coalescing behaviors. (109723704)"

https://developer.apple.com/documentation/ios-ipados-release-notes/ios-ipados-17-release-notes

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