Post

Replies

Boosts

Views

Activity

Persist a set of variables with SwiftData
Hi! I'm creating a document based app using DocumentGroup. I want to make persistent a set of variables that represent a certain setup of the document. I have followed the example in https://developers.apple.com/videos/play/wwdc2023/10154. If I want to implement a set of variables that define for instance the color background of a set of flashcards. How can I do it? I cannot use @Query because these set of variables is not an array. I cannot use userDefaults either because I want this set of variables to be bonded to the document and not to my application. Thank you very much for the help!
0
0
377
Nov ’23
Persist a set of variables with SwiftData
Hi! I'm creating a document based app using DocumentGroup. I want to make persistent a set of variables that represent a certain setup of the document. I have followed the example in https://developers.apple.com/videos/play/wwdc2023/10154. If I want to implement a set of variables that define for instance the color background of a set of flashcards. How can I do it? I cannot use @Query because these set of variables is not an array. I cannot use userDefaults either because I want this set of variables to be bonded to the document and not to my application. Thank you very much for the help!
Replies
0
Boosts
0
Views
377
Activity
Nov ’23
Save images in SwiftData models with document based apps
Hi! I am creating a document based app and I am wondering how can I save images in my model and integrate them in the document file. "Image" does not conform to "Persistence model" and I am sure that "Data" will be saved in the document file. Any clue on how can I do it? Many thanks.
Replies
1
Boosts
0
Views
1.3k
Activity
Jan ’24