Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
1 vote
1 answer
69 views

Background: I have complex Swift Data models with some Relationships, and at some point, my Xcode Preview is no longer working when I want to init a ModelContainer in it. So I tried to debug and ...
Best practices
0 votes
3 replies
54 views

In SwiftData / CloudKit, when you have a root model object, it's pretty straightforward when you want to add or delete it from the model: simply use a modelContext variable and use its insert and ...
0 votes
1 answer
69 views

I have been struggling with arbitrary behavior in SwiftData when using a two-layer relationship in a predicate. I wrote a very simple app to verify this behavior. I have three models, grandparent, ...
0 votes
1 answer
50 views

I'm testing SwiftData model inheritance (new in iOS 26) and encountering a crash when combining: A model that inherits from another model A separate model with relationships to the parent class ...
Advice
0 votes
1 replies
50 views

I am currently in the middle of developing an iOS app which uses SwiftData. I want to future proof my data models by laying the ground work for data migrations down the line but I am pretty new to the ...
2 votes
1 answer
98 views

I am trying to set a predicate on an array of objects inside a SwiftUI View (and failing to do so) My data models consist of two independent tables and a third table that holds associations between ...
0 votes
0 answers
78 views

I'm experiencing the following error with my SwiftData container when running a build: Code=134504 "Cannot use staged migration with an unknown model version." Code Structure - Summary I ...
2 votes
1 answer
88 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 ...
0 votes
0 answers
35 views

My application contains two different databases. The first contains information that does not change and will be distributed in the app's bundle. The second contains information that can be edited and ...
Best practices
0 votes
9 replies
123 views

I have two SwiftData models like below: @Model final class SDStock { init() {} var id = UUID() var title = "abc" var code = "123456" @Relationship(deleteRule: ....
0 votes
1 answer
93 views

I am trying to use a custom property inside a SwiftData model: import SwiftData struct Foo { var name: String } @Model final class Bar { var id: String var name: String var foo: Foo ...
koen's user avatar
  • 5,872
1 vote
2 answers
136 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 ...
2 votes
1 answer
272 views

I’m using Swift 6.2 with MainActor set as the default global actor in my project. When I create a SwiftData @Model that conforms to a protocol extending PersistentModel, I get actor isolation errors ...
1 vote
1 answer
79 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
  • 811
0 votes
1 answer
83 views

I'm working on an app where I have a view AddMonthView where you put in the monthly balance for financial accounts. That account list is dynamic. So I spent some time trying to figure out how to bind ...

15 30 50 per page
1
2 3 4 5
...
54

AltStyle によって変換されたページ (->オリジナル) /