#swiftdata — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #swiftdata, aggregated by home.social.
-
Fun With SwiftData and CloudKit!: https://pmcconnell.micro.blog/2026/04/30/fun-with-swiftdata-and-cloudkit.html
-
If you have a #SwiftUI List/Grid and you are iterating over Model objects using id: \.self you may encounter a duplicate key in dictionary error resulting in a crash.
Changing to id: \.id or removing the id parameter entirely should resolve this issue.
for example:
forEach(photo, id: \.self) *boom*
forEach(photo) or forEach(photo, id: \.id) all good
Tricky to debug from the error message/trace but easy fix.
-
Optimize your view because we're going to machine gun update it is never the right answer. None of the data is changing. Zero updates are warranted.
#Xcode just logs some computed property changed and redraws. In a sample app I provided Apple (naively, I know) This happens with a list of models that contain nothing more than a timestamp. No computed properties.
This is a framework problem, not something I can optimize away.
-
6 months later I'm still stuck on a issue where #SwiftData queries refresh the view excessively.
I’ve seen very few references to anything similar in online and any time an Apple engineer replies they suggest limiting the fetched objects.
That's not always possible, nor is it a “solution.” In my app I'm rendering complex paths on a map view and the coordinates that make up the path can't be limited.
Excessive, unnecessary redraws are visible and a UX problem.
-
Some tech stuff is painful enough to “learn” it once and just keep reusing the same code/patterns over and over for years.
This is to say I added some new #SwiftData stuff to my app today, adding some fairly trivial schema migrations.
It’s just too tedious to search for improvements or better ways to do things. It works, but as with many #SwiftUI things it does not leave one feeling overly confident.
-
Build a Flash Card app in #SwiftUI using #SwiftData. One of two apps my students needed to build w/o AI during their hands-on 2.5 hr. in-class 2nd mid-term. Use this as a test, (pause after each question shown, complete, and compare answers), or watch it as a refresher lesson that provides a "recipe" breakdown for thinking about basic SwiftData setup w/MockData. https://youtu.be/pyKM3FJhQWg #CSed, #ADE, #Swift
-
Build a Flash Card app in #SwiftUI using #SwiftData. One of two apps my students needed to build w/o AI during their hands-on 2.5 hr. in-class 2nd mid-term. Use this as a test, (pause after each question shown, complete, and compare answers), or watch it as a refresher lesson that provides a "recipe" breakdown for thinking about basic SwiftData setup w/MockData. https://youtu.be/pyKM3FJhQWg #CSed, #ADE, #Swift
-
Build a Flash Card app in #SwiftUI using #SwiftData. One of two apps my students needed to build w/o AI during their hands-on 2.5 hr. in-class 2nd mid-term. Use this as a test, (pause after each question shown, complete, and compare answers), or watch it as a refresher lesson that provides a "recipe" breakdown for thinking about basic SwiftData setup w/MockData. https://youtu.be/pyKM3FJhQWg #CSed, #ADE, #Swift
-
Build a Flash Card app in #SwiftUI using #SwiftData. One of two apps my students needed to build w/o AI during their hands-on 2.5 hr. in-class 2nd mid-term. Use this as a test, (pause after each question shown, complete, and compare answers), or watch it as a refresher lesson that provides a "recipe" breakdown for thinking about basic SwiftData setup w/MockData. https://youtu.be/pyKM3FJhQWg #CSed, #ADE, #Swift
-
Build a Flash Card app in #SwiftUI using #SwiftData. One of two apps my students needed to build w/o AI during their hands-on 2.5 hr. in-class 2nd mid-term. Use this as a test, (pause after each question shown, complete, and compare answers), or watch it as a refresher lesson that provides a "recipe" breakdown for thinking about basic SwiftData setup w/MockData. https://youtu.be/pyKM3FJhQWg #CSed, #ADE, #Swift
-
FB21159411 #CloudKit causes excessive view updates with #SwiftData Queries
Things are pretty bad for me to file feedback.
App views are updated far too often regardless if data changes. (at least on MacOS)
For simple text views you are unlikely to notice. With more complex views such as a map with the markers dancing around with each update it is a deal breaker.
I am wondering if this is causing some sketchy app behavior in Tahoe?
or I'm holding it wrong…
-
It’s kinda fun that you can go from a local app to a multi-platform client/server app using #SwiftUI and #SwiftData with very few changes to your data model and with no changes to the APIs you call
#SwiftLang #BuildInPublic #Technology #Apple #CloudKit #Apps
-
Офлайн-режим в мобильном приложении: зачем он нужен и как его реализовать
Представьте: пользователь открывает ваше приложение в метро, за секунду до въезда в тоннель. Вместо ошибки «Нет соединения» он видит контент, который уже загрузил, или даже продолжает заполнять форму — потому что приложение просто отложит синхронизацию до момента, когда сеть появится. Это не магия, а продуманный офлайн-режим. В этой статье мы расскажем как реализовать его в приложении на iOS.
https://habr.com/ru/companies/beget/articles/943730/
#офлайнрежим #uiux #uiux_design #работа_в_офлайне #ios_development #ios_design #ios #swift #swiftdata
-
I am still checking, butI think that I have encountered this:
https://developer.apple.com/forums/thread/734079?answerId=759407022#759407022
#CoreData presumably created a new CloudKit CKAsset field for an `externalStorage` property at runtime when it encountered an asset that is too large for the database. This causes automatic #SwiftData CloudKit sync to fail because that record doesn't exist in the server.
If so, this is broken, it should create all fields it'll eventually need so that they can be properly added to the production CloudKit schema.
-
I filed this feedback to make Enums better with SwiftData: FB19106719
@ricketson @lucabernardi @curtclifton
I couldn’t find anyone working in the #CoreData or #SwiftData team so I ping you. Thank you.
-
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 :)
#swift #swiftlang #swiftdata #sharinggrdb #structuredconcurrency
-
Here’s an updated version of the post:
First iteration of the “No Baby View“
I’ve designed this view to be simple and clean using SwiftUI. It’s still a work in progress…What do you think? I’d love to hear your feedback!
#iOSDevelopment #Swift #SwiftUI #SwiftData #AppDevelopment #iOSAppDesign #IndieDev #CodingLife #SwiftLang #MobileAppDesign #UIUX #SwiftCoder
-
So.. I could release #PingU - the IoT GPS tracker app for #iOS I've been working on for the past weeks but there's a regression in #SwiftData for iOS18 and 18.1 beta that prevents it from properly working with #SwitfUI and as a result the user doesn't actually see most UI updates caused by location changes until they either reopen the app or navigate around between views.
And I refuse to release the app in this state :ac_distress:
I'm also not alone in having these issues either, a lot of people are discussing it on the developer forums and are filing - as of now unaddressed - Feedback reports.
It's a stupid situation because otherwise things are working really well (and with next to no battery impact) and I've been using PingU as a replacement for #HomeAssistant's location tracking as well as GPSLogger's hooks feature for the past weeks now.
-
Shoutout to #SwiftData for already breaking some of the API explanations in #WWDC23 videos 🙄
-
This doesn’t feel like it should be *this* hard. Seeing things like #LiveBlocks & the plethora of other JS Frameworks, kinda makes Apple’s stuff look lackluster.
Sure we have #Shareplay, but it’s still not fully featured. (Read: persistent sessions)
One route is something like Boutique for local storage, CoreData for sync (CKSyncEngine?), & SharePlay for real-time. It just seems so convoluted, though. 🤔
-
Why should I use #Userpreferences in my app if I have already #SwiftData in use? #swiftui #swift #iosdev
-
🚀 Welcome to #Stuffatory 3.0.0! 🚀
Now with #SwiftData integration. I've squashed bugs and fine-tuned performance to ensure Stuffatory runs seamlessly.
Join me in this upgrade and make organizing your stuff a breeze!
-
I need a clear description of how to build #SwiftData predicates programmatically. I have two orthogonal scope-like settings so there would be an explosion of code copying if I must use #Predicate to create the FetchDescriptor.
-
So many reasons to target iOS 17+ & drop support for older versions:
- MapKit for #SwiftUI (annotations & overlays)
- #CoreLocation now supports live updates using Swift concurrency’s async/await capability
- #SwiftData (no, just a joke, I'll stick to my #CoreData stack for now) -
#Today Charted out chapters 3 and 4 of #SwiftData and figured out the challenge for Chapter 2. the #SwiftPlaygrounds Course for non programmers is complete and packaged off to LinkedIn.
-
Trying out #swiftdata, and #macOSSonoma running in #utmapp virtualization is surprisingly usable even on a 16 GB M1. Just the slightest of lags, which for my purposes is much better than risking my actual account/data/computer.