It's 2025 and it's still incredibly hard to achieve good iCloud sync without duplication of data. It's the developer's job to do this and it's so error prone if you don't do everything correctly. #WWDC #SwiftUI #CoreData #SwiftData
If you want to toy around with #SwiftData, but need some sample data, I have that #Northwind import. Which took a loooong time, but once it is in, it's ok
https://github.com/Northwind-swift/NorthwindSwiftData
Adventures in mystery: if you use @Attribute(.externalStorage) in your #SwiftData app, how can you determine whether or not your data is stored in your db or externally?
Where's it stored in a Document-based app on macOS?
Fun times from exploring an (unrelated) db migration issue.
Am I missing something, or are relationships in #SwiftData incredibly expensive? Inserting just 2,409 entries with a relationship takes 21s, compared to 0.5s without. Autosave is off, and I'm manually saving every 1,000 entries. What am I doing wrong?
Found another bug in #SwiftData and submitted Feedback this time with a Swift Testing suite to see if that helps get it fixed faster:
FB17593538: Inserted child model loses its relation to parent upon save if a fetch for the parent is done using includePendingChanges false in between insert and save
https://github.com/feedback-assistant/reports/issues/658
Note: Core Data can do this without issue.
#SwiftData @.Model's implementation of id breaks the Identifiable protocol because it is not stable between insert and save. This means it does not work reliably with .sheet(item:) and is inefficient with List/ForEach.
How do you write SwiftData predicates to query for parent relationships? #iOSDev #SwiftData #SwiftUI https://useyourloaf.com/blog/swiftdata-predicates-for-parent-relationships/
I dug a little deeper into SwiftData and added one last quality of life improvement for version 2.0: widgets now show favorites and seen status and can now be filtered accordingly
#BuildInPublic #SwiftData
@leogdion For #SQLite I also have Lighter, which I think is actually really good: https://github.com/Lighter-swift
And for Core Data I have replicated the #SwiftData macros: https://github.com/Data-swift/ManagedModels/
This by @mattiem might also be relevant to your article: https://mastodon.social/@mattiem/114359442297769327
I mentioned last week I would put together a blog post gathering my thoughts and process in working thru #SwiftData Migrations.
Have at it…
SwiftData Migrations and the Real World: https://pmcconnell.micro.blog/2025/04/15/swiftdata-migrations-and-the-real.html
With Xcode 16.3 I'm seeing different #SwiftData auto-save behaviour in the simulator. Edits are now auto-saved a 10 sec delay. Weirdly the insert I tried in an onAppear (at same time app launch) is saved instantly. Previously the only auto-saves I saw on iOS were during app suspend.