Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
-1 votes
0 answers
31 views

Read SwiftData store metadata using Core Data

I need to access store metadata, like version identifiers (NSStoreModelVersionIdentifiers). The starting point is a SwiftData stack, so I have my instance of ModelContainer and my ModelConfiguration. ...
Andrea Mario Lufino's user avatar
-2 votes
0 answers
66 views

Is there a way to quickly read a lot of data from 'SwiftData'?

I will create an app that supports purchase records. I used 'SwiftData' to implement storage, backup, and restoration functions at once. One problem is that it takes a lot of time to read the data ...
KimJitae's user avatar
  • 233
0 votes
1 answer
53 views

SwiftData - How to build the multiple-to-multiple relationship between two data models?

Suppose I want to built Student and Course data models, and I want that each student is registered with multiple courses and each course contains multiple students. What should I do? Here is what I ...
HelloVictor2000's user avatar
2 votes
1 answer
36 views

How to share the same model container between WindowGroup and MenuBarExtra in SwiftUI?

I am working on a SwiftUI application where I need to share the same model container between a WindowGroup and a MenuBarExtra. The goal is to have both components update in sync without needing to ...
Lucas Buchalla Sesti's user avatar
-1 votes
0 answers
40 views

String representation of SwiftData PersistentIdentifiers

The PersistentIdentifier of SwiftData entities is a Codable Struct. I would like to derive a String that uniquely identifies each entity instance (at least within the current ModelContainer). The ...
Peter's user avatar
  • 735
-1 votes
0 answers
39 views

How do relationships not cause infinite loops?

So I'm still learning SwiftData and the one thing I cannot get my head around is how relationships don't cause infinite loops. For example, using SwiftData, if you want to list all the films an actor ...
sam0701's user avatar
  • 11
1 vote
0 answers
59 views

SwiftData rollback not updating the UI

I'm building a simple App using SwiftData. In my app a user can create, remove and edit posts. When editing, I want them to be able to hit "Save" to persist the changes or "Cancel" ...
alexortizl's user avatar
  • 2,555
0 votes
0 answers
39 views

draggable/dropDestination causing runtime error (EXC_BAC_ACCESS)

I feel like I'm missing something here but can't figure it out. I've got two SwiftData models joined as a relationship. The idea being that the user drags the name of a device from a list and they can ...
sam0701's user avatar
  • 11
1 vote
2 answers
90 views

View not updating when relationship array changes

I'm working on a SwiftUI app using SwiftData for persistence. I have a TaskModel class with a relationship to DailyProgress objects. When I update the progress, the view doesn't reflect the changes. ...
Марина Василевская's user avatar
1 vote
1 answer
36 views

Fix error when make SwiftData model conform to AppEntity Protocol

I tried to make a SwiftData model conform to AppEntity protocol to use it as a parameter in AppIntent, I got the example code from App Intent driven development in Swift and SwiftUI , but I got an ...
Ammar Ahmad's user avatar
1 vote
1 answer
64 views

SwiftData Versioning "Cannot use staged migration with an unknown coordinator model version."

I've started developing app with SwiftData and decided to move to VersionedSchema recently and it just fails when I try to add a new version of a schema with Code=134504 "Cannot use staged ...
Aleks Kuznetsov's user avatar
0 votes
1 answer
61 views

Correct way to write a @model in swiftdata

I'm working on a Swift project where I have two model classes: PlaylistGroup and PlaylistItem. I'm running into an issue where I can't append items to the playlistItems property in PlaylistGroup. ...
Damiano Miazzi's user avatar
0 votes
0 answers
29 views

Storing and Retrieving RGB with SwiftData

I am out of ideas. I am trying to have a color theme picker in a view that would allow selection of predefined color theme values, store it in SwiftData as persistent storage and then use it ...
fedjedmedjed's user avatar
1 vote
1 answer
67 views

When pre-populating swiftdata, how to handle updates?

I’m pre-populating an app with an existing database that’s to be shipped with the app. My approach is similar to the one outlined here and it works for an initial database, but now I need to update ...
KidBaco's user avatar
  • 71
0 votes
0 answers
47 views

SwiftData no such table error for one of models

I have 2 models in my app, fist (ModelA) is working fine - data is persistent no matter how many times I restart app on the simulator, but the second (ModelB) sometimes losts it data and I see errors ...
moonvader's user avatar
  • 20.9k

15 30 50 per page
1
2 3 4 5
25