mastouille.fr est l'un des nombreux serveurs Mastodon indépendants que vous pouvez utiliser pour participer au fédiverse.
Mastouille est une instance Mastodon durable, ouverte, et hébergée en France.

Administré par :

Statistiques du serveur :

586
comptes actifs

#swiftdata

0 message0 participant0 message aujourd’hui

I'm loving the new @pointfreeco SharingGRDB framework! It's so much better to work with value-type models than reference-type models.

In the code below I'm migrating from SwiftData to SharingGRDB. First I put the creation of the Weight.Draft inside the async block below. This gave me an error because the SwiftData models are not sendable. The SharingGRDB models are so the fix was so simple :)

Heeeelp!

What does the following error mean, and how do I fix it? It happens, when I call `modelContext.save()` in a SwiftUI view.

"SwiftData/ModelCoders.swift:105: Fatal error: Composite Coder only supports Keyed Container”

Edit: Solved! It appears SwiftData does not support Duration properties in models. Changing it to a TimeInterval instead fixes it.

S4E5: @mikaelacaron and @twostraws talk networking – mostly about getting computers to talk to each other, but also, just as dauntingly, about talking to other humans at conferences too. 😱

Plus: news, Apple delays, and the trifling little matter of the major changes you’re hoping to see in #Xcode, #SwiftUI, #SwiftData and more as #WWDC25 rolls around!

🎧 podcasts.apple.com/gb/podcast/

Apple PodcastsS4E5: Could you just…?Podcast Episode · Swift over Coffee · 23/03/2025 · 33m

Refactored a gnarly bundle of code to make it correct for #Swift Concurrency.

I have a better handle on it all now but I still see a few areas it needs to improve

Passing results from async to the main thread is far too difficult requiring a lot of scaffolding to allow: self.stuff = asyncStuff

#SwiftData needs to work better with async/await. One side of the other needs to improve.

In general, it's just too much thinking, tweaking and adorning your code with magic keywords and types

My app, #PDXTransit, turns 10 years old this year this August. I wrote it when I moved to Portland back in 2015.

Well, this year for its 10th birthday, I plan to release a complete re-write using the latest technologies from Apple including an iPad-specific user experience.

Here's a sneak peek at what I've been working on the past few years with #SwiftUI, #SwiftConcurrency, and #SwiftData!!!

(and of course it comes with a re-write of its companion app for Apple Watch!)

A répondu dans un fil de discussion

Today in Bike Index:
- Merged Bike ↔︎ User/AuthenticatedUser relationships, transactions, and frequent save() to fix the #1 crash/bug report
- Fixed GitHub "Enable auto-merge [after PR checks pass]" (gotta use jobs > build > name: Run tests with fastlane → Ruleset add checks
- Converted Xcode project groups to Folders

New in PR review:
- Added app version to Settings
- Updated README with TestFlight public beta link and incremented to version v1.1!
Phew what a day! 🤩
#iOSDev #SwiftUI #SwiftData

Has anyone else used #SwiftData based DocumentGroup in #SwiftUI?

It is pretty convenient compared to rolling your own storage solution. I’m able to create a custom file extension and I can keep all SwiftData properties non-optional which cannot be done with CloudKit.

However, I have had it happen a couple times where the file will refuse to open on #iPadOS after having it opened on #macOS, which is a cause for concern because I cannot afford data loss. Especially since it doesn’t appear to be possible to create backups of the file, or prevent it from being opened on more than one device, etc.

I am not sure what causes this as theres no errors in Xcode when it happens… Any ideas why that might be?

#SwiftData ModelActor changes aren't reflected by the Query property wrapper in #SwiftUI Views...

This issue has been raised months ago & I don't understand why it's still not fixed in iOS 18.2.

A workaround is to observe the ModelContext didSave notif: forums.developer.apple.com/for

cc @curtclifton @ricketson @lucabernardi if you know someone at Apple working on SwiftData with SwiftUI, can you please escalate this? This is a massive hiccup.

long overdue - I used Queried in a new feature, and fixed various problems github.com/juanarzola/Queried/

- It actually does work in iOS 18 (new notification)
- it doesn't try to use the "filter" AsyncStream transform which, in my experience/crashes runs in a thread that is different from the one the notification is posted on.
- It no longer returns the query results in the async stream because they are not sendable, a requirement for AsyncStream (and Swift 6.0). #SwiftData

github.com/juanarzola/Queried/

GitHub:bug: Do not access ModelContext from an unsupported thread by juanarzola · Pull Request #9 · juanarzola/QueriedModelContext needs to be accessed in the thread of the notification. Using filter seems to change the thread, which causes race/condition crashes I've experienced. Fix this by handling the noti...