Skip to main content
Filter by
Sorted by
Tagged with
2 votes
1 answer
66 views

I'm working on a SwiftUI app using SwiftData, and I'm very new to both frameworks, and swift in general to be honest. I'm trying to create a webview that embeds a monaco editor that will then send the ...
Fluster.IO's user avatar
Best practices
0 votes
9 replies
121 views

I have two SwiftData models like below: @Model final class SDStock { init() {} var id = UUID() var title = "abc" var code = "123456" @Relationship(deleteRule: ....
stephen's user avatar
  • 597
1 vote
2 answers
111 views

I’m new to iOS development and currently learning to persist data using SwiftData. I’m building a very simple to-do list app to understand how local persistence works. However, I’ve hit a wall and ...
Kevin Rodriguez's user avatar
1 vote
1 answer
78 views

Obviously it isn't allowed to put the @Relation(inverse)-annotation on both models. Otherwise one receives an error-message about "Circular Reference". Therefore, should one put the ...
mewi's user avatar
  • 791
0 votes
0 answers
177 views

Every time I insert a subclass (MYShapeLayer) into the model context, the app crashes with an error: DesignerPlayground crashed due to fatalError in BackingData.swift at line 908. Never access a full ...
Mohammed's user avatar
  • 1,504
0 votes
1 answer
122 views

I need help debugging why my app is failing on hardware trying to initialize the ModelContainer. This is my first app so I may be missing something obvious, but I have two models that I'm trying load, ...
Open-Analysis's user avatar
1 vote
1 answer
75 views

I need a way to keep a global count of all model items in SwiftData. My goal is to: track how many entries exist in the model. have the count be reactive (update when items are inserted or deleted). ...
markb's user avatar
  • 1,381
1 vote
1 answer
64 views

I’m building a document‑based Swift UI app using DocumentGroup with SwiftData. I want: A document‑scoped model (Gate) that is persisted inside a file An app‑scoped model (User) that is stored in the ...
DeEskalator's user avatar
1 vote
0 answers
67 views

I'm working on an independent watchOS app and I was looking for the best solution to persist data locally and have an online sync with the iCloud storage. I've found out about the SwiftData which is ...
kachmashk's user avatar
0 votes
0 answers
44 views

I’m migrating a small SwiftData model from Swift 5 to Swift 6. The same code compiles under Swift 5, but with Swift 6 it fails when the @Model macro expands a property whose type conforms to Codable. ...
markb's user avatar
  • 1,381
4 votes
2 answers
376 views

Summary I have a View Model class, paired with a SwiftUI View, that fetches filtered entries from SwiftData using a ModelActor. I've used SwiftUI's .task(id:) to trigger re-loads in the View Model ...
Neill's user avatar
  • 1,176
0 votes
2 answers
240 views

Hello, I'm trying to create a simple app with inheritance and SwiftData. Unfortunately, I keep getting the same error with this example: Thread 1: Fatal error: Never access a full future backing data ...
hilaprodomo's user avatar
0 votes
0 answers
71 views

In my SwiftData model one of the properties is set to Data? with externalStorage option. So, it means that it will not be stored in the actual database but a reference will be in the database and file ...
john doe's user avatar
  • 9,764
1 vote
1 answer
207 views

I'm working with SwiftData and trying to replicate behavior similar to what I used to do with CoreData, where I had an extension on NSManagedObjectContext that allowed me to fetch all stored objects, ...
Richard Witherspoon's user avatar
1 vote
1 answer
356 views

I'm using the swiftdata-sectionedquery package. It basically allows SwiftData to have a SectionedFetchRequest. The problem I am running into is I keep getting this error whenever I try to foreach on ...
Neglected Sanity's user avatar
0 votes
0 answers
78 views

Problem Description When using SwiftUI's @Query with SwiftData models, I encountered confusion about reactivity triggering. In certain situations, SwiftUI's reactivity mechanism doesn't work as ...
xinnjie's user avatar
  • 660
0 votes
0 answers
46 views

I have this code: import SwiftUI import SwiftData @Model final class Item { @Attribute(.unique) var id = UUID() private(set) var name: String init(name: String) { self.name = ...
Whirlwind's user avatar
  • 12.6k
0 votes
0 answers
112 views

I have some models in my app: [SDPlanBrief.self, SDAirport.self, SDChart.self, SDIndividualRunwayAirport.self, SDLocationBrief.self] SDLocationBrief has a @Relationship with SDChart When I went live ...
PW1990's user avatar
  • 489
0 votes
0 answers
32 views

I'm working with SwiftData and trying to filter my data using predicates with a custom enum, but I'm getting an error when the predicate executes: SwiftDataError(_error: SwiftData.SwiftDataError....
MohAliBou's user avatar
  • 265
3 votes
1 answer
52 views

I'm doing the SwiftData tutorial on Hacking With Swift, and I'm trying one of the challenges which is to add a swipe to delete on a list of related models. I thought I had the right idea, but I'm ...
Ryan Clare's user avatar
1 vote
0 answers
51 views

Is it possible to convert a NSPersistentHistoryToken to a DefaultHistoryTransaction.TokenType (DefaultHistoryToken)? func subscribeToModelChanges() async { NotificationCenter.default.notifications(...
nicolas Lrr's user avatar
0 votes
1 answer
135 views

Edit with minimal reproducible example: @main struct SwiftDataTestApp: App { var sharedModelContainer: ModelContainer = { let schema = Schema([ Team.self, Player.self ])...
soleil's user avatar
  • 13.3k
0 votes
0 answers
99 views

I am developing a Screen Time App for iOS and I am having issues with the ShieldConfigurationExtension (ShieldConfigurationDataSource). I know this extensions is sandboxed but I should be able to read ...
Lukáš Matuška's user avatar
1 vote
1 answer
353 views

I'm currently developping an app, which runs on several devices via TestFlight. Since I am still in an early stage my @Models are subject to change quite frequently. I know that the preferred way of ...
Meyssam's user avatar
  • 931
1 vote
0 answers
128 views

I'm encountering an error when trying to save a SwiftData entity with a transformable attribute that should handle an array of strings. The error occurs specifically when the array is empty. The Error ...
Soheil Novinfard's user avatar

1
2 3 4 5
16