veganism.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
Veganism Social is a welcoming space on the internet for vegans to connect and engage with the broader decentralized social media community.

Administered by:

Server stats:

295
active users

#swiftdata

0 posts0 participants0 posts today
Jonathan :mac:<p>Does anyone know how to move from an unversioned CoreData / Swift Data model to a versioned SwiftData model? I’m getting the following error:</p><p>"Cannot use staged migration with an unknown coordinator model version."</p><p><a href="https://techhub.social/tags/indiedev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>indiedev</span></a> <a href="https://techhub.social/tags/iosdev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>iosdev</span></a> <a href="https://techhub.social/tags/swiftdata" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>swiftdata</span></a> <a href="https://techhub.social/tags/swift" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>swift</span></a></p>
aaron<p>Let’s say I want to display &gt; 100k items from <a href="https://mastodon.social/tags/SwiftData" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>SwiftData</span></a> in a Table view in <a href="https://mastodon.social/tags/SwiftUI" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>SwiftUI</span></a>: is there a way to do that lazily so performance doesn’t become a nightmare? Or do I need to use AppKit’s NSTableView instead? <a href="https://mastodon.social/tags/macOSDev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>macOSDev</span></a> <a href="https://mastodon.social/tags/Swift" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Swift</span></a></p>
Roman<p>Anyone done heavy <a href="https://mastodon.social/tags/SwiftData" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>SwiftData</span></a> migrations with iCloud sync? If I turn it off, then the migration is successful, but as soon as I add `cloudKitDatabase: .automatic` to the ModelConfiguration it crashes with Error.loadIssueModelContainer. Cannot find anything online</p>
Helge Heß<p>Is the <a href="https://mastodon.social/tags/SwiftLang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>SwiftLang</span></a> Predicate macro used for anything else but <a href="https://mastodon.social/tags/SwiftData" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>SwiftData</span></a>? E.g. RealityKit has its own `QueryPredicate`.<br>It almost seems that Predicate is indeed somewhat useless w/o also standardizing the static metadata property, currently part of SwiftData's `PersistentModel`: <a href="https://developer.apple.com/documentation/swiftdata/persistentmodel/schemametadata" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">developer.apple.com/documentat</span><span class="invisible">ion/swiftdata/persistentmodel/schemametadata</span></a><br>As per <a href="https://forums.swift.org/t/keypath-string/77732" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">forums.swift.org/t/keypath-str</span><span class="invisible">ing/77732</span></a></p>
Cameron McEfee<p>What’s the current story around CloudKit sharing and <a href="https://mastodon.social/tags/swiftdata" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>swiftdata</span></a>? I know the common understanding is “it isn’t natively supported” but I see lots of hints (but no examples) online that it’s doable with extra work. I’m curious what that extra work actually is and whether it’s something attainable.</p>
Aleksander Stojanowski<p>Any advice from more experienced <a href="https://iosdev.space/tags/IndieHackers" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>IndieHackers</span></a> when it comes to such operations? 😅<br><a href="https://iosdev.space/tags/iOSDev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>iOSDev</span></a> <a href="https://iosdev.space/tags/SwiftData" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>SwiftData</span></a> <a href="https://iosdev.space/tags/IndieDev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>IndieDev</span></a></p>
Helge Heß<p><a href="https://mastodon.social/tags/SwiftData" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>SwiftData</span></a> is a beauty. (also, all that WET)</p>
Axel Le Pennec<p>I wish Apple used SwiftData in its sample <a href="https://iosdev.space/tags/WWDC25" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>WWDC25</span></a> code projects...</p><p>It would have been a great opportunity to showcase how to use SwiftData properly with App Intents using an AppDependencyManager for example.</p><p><a href="https://iosdev.space/tags/SwiftData" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>SwiftData</span></a> <a href="https://iosdev.space/tags/iOSDev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>iOSDev</span></a></p>
Axel Le Pennec<p>Oh wow 😲</p><p>SwiftData models are now Sendable! 🤩</p><p>And it has been backported to iOS 17.0+! 🥳</p><p>This will make working in with concurrent code easier.</p><p>Documentation updated during WWDC25: <a href="https://developer.apple.com/documentation/swiftdata/model" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">developer.apple.com/documentat</span><span class="invisible">ion/swiftdata/model</span></a>()</p><p><a href="https://iosdev.space/tags/SwiftData" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>SwiftData</span></a> <a href="https://iosdev.space/tags/WWDC25" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>WWDC25</span></a></p>
Aleksander Stojanowski<p>Especially the <a href="https://iosdev.space/tags/SwiftData" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>SwiftData</span></a> related code. I moved everything into the background thread, so that app works smoothly, but at the cost of code readability. Until I worked daily on that, it seemed fine. Nowadays, I see a lot of things I could improve.</p>
Nico Reese<p>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. <a href="https://mastodon.social/tags/WWDC" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>WWDC</span></a> <a href="https://mastodon.social/tags/SwiftUI" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>SwiftUI</span></a> <a href="https://mastodon.social/tags/CoreData" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CoreData</span></a> <a href="https://mastodon.social/tags/SwiftData" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>SwiftData</span></a></p>
Tim De Jong<p>I'm loving the new <span class="h-card" translate="no"><a href="https://hachyderm.io/@pointfreeco" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>pointfreeco</span></a></span> SharingGRDB framework! It's so much better to work with value-type models than reference-type models. </p><p>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 :) </p><p><a href="https://mastodon.social/tags/swift" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>swift</span></a> <a href="https://mastodon.social/tags/swiftlang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>swiftlang</span></a> <a href="https://mastodon.social/tags/swiftdata" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>swiftdata</span></a> <a href="https://mastodon.social/tags/sharinggrdb" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>sharinggrdb</span></a> <a href="https://mastodon.social/tags/structuredconcurrency" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>structuredconcurrency</span></a></p>
Aleksander Stojanowski<p>I prepared a great surprise for myself… I was sure the <a href="https://iosdev.space/tags/WWDC25" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>WWDC25</span></a> starts tomorrow. 🙈 I wasn’t even hyped yet, but I’m now, since this morning. 😁 I don’t have any expectations, but everything related to <a href="https://iosdev.space/tags/SwiftData" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>SwiftData</span></a> &amp; <a href="https://iosdev.space/tags/SwiftUI" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>SwiftUI</span></a> will be great. 😁</p>
Denis Gladkikh<p>This is one of the most satisfying projects I have ever worked on. MacInspector 0.1. Going to open a beta soon.</p><p><a href="https://mastodon.social/tags/SwiftData" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>SwiftData</span></a> <a href="https://mastodon.social/tags/SwiftUI" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>SwiftUI</span></a> <a href="https://mastodon.social/tags/macOS" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>macOS</span></a> <a href="https://mastodon.social/tags/Swift" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Swift</span></a></p>
Aleksander Stojanowski<p>I published a hot fix update this morning, but I even forgot to post about it. But it’s live and you can download it already. 😅 I, on the other hand, have been struggling with moving <a href="https://iosdev.space/tags/SwiftData" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>SwiftData</span></a> models to the shared framework. I can swear I worked yesterday! 😆<br><a href="https://iosdev.space/tags/BuildInPublic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>BuildInPublic</span></a> <a href="https://iosdev.space/tags/IndieHacker" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>IndieHacker</span></a> <a href="https://iosdev.space/tags/iOSDev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>iOSDev</span></a> <a href="https://iosdev.space/tags/IndieDev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>IndieDev</span></a></p>
Aleksander Stojanowski<p>I searched a bit for what might be a problem and luckily I found the solution! All I needed to do was to move injecting <a href="https://iosdev.space/tags/SwiftData" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>SwiftData</span></a> model container into my RootView instead of WindowGroup as I did up to this point.</p>
Yannick Lung<p>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 ✨<br><a href="https://mastodon.social/tags/BuildInPublic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>BuildInPublic</span></a> <a href="https://mastodon.social/tags/SwiftData" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>SwiftData</span></a></p>
Aleksander Stojanowski<p>Well, not exactly. Someone on <a href="https://iosdev.space/tags/Stackoverflow" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Stackoverflow</span></a> had almost the same problem some time ago. The workaround for that is to wrap the problematic view with @/Query inside another one without it. It’s not the nicest solution, but it works on all versions of iOS.<br><a href="https://iosdev.space/tags/SwiftData" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>SwiftData</span></a></p>
Patrick McConnell<p>Biggest tip I can offer when working through a migration strategy, is to work on a new git branch so you can delete a bad data store, restore the old working branch and start over.</p><p>You can create a rollback strategy as well but I found it just as easy to delete the bad data store, revert to working data and try again.</p><p>If you don't start a migration clean and it has previously failed you may find a lot of duplicate data once it does work all the way thru.</p><p> <a href="https://mastodon.social/tags/SwiftData" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>SwiftData</span></a> <a href="https://mastodon.social/tags/Swift" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Swift</span></a> <a href="https://mastodon.social/tags/iOSDev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>iOSDev</span></a> <a href="https://mastodon.social/tags/macOSDev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>macOSDev</span></a></p>
Patrick McConnell<p>In my case I was migrating from a schema where a relationship was becoming many to many. I needed to gather all the current single relationships in willMigrate and then in didMigrate I had to add them to the new to many relationship.</p><p>There is no relationship between willMigrate and didMigrate so you need to do some sketchy (globals) things to pass data across contexts.</p><p>Once I'm comfortable I've gotten this all correct, I’ll do a blog post.</p><p><a href="https://mastodon.social/tags/SwiftData" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>SwiftData</span></a> <a href="https://mastodon.social/tags/Swift" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Swift</span></a> <a href="https://mastodon.social/tags/iOSDev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>iOSDev</span></a> <a href="https://mastodon.social/tags/macOSDev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>macOSDev</span></a></p>