Post

Replies

Boosts

Views

Activity

Reply to Mutating an array of model objects that is a child of a model object
@joadan What you're saying about an array being a value type even if it has reference types makes sense to me. What I'm a little confused about is that when I pass subcategories by reference in the sample project I have (i.e. passing it as a parameter to a struct where it's declared as var subcategories: [Subcategory], it still does update when I mutate the array using project.subcategories?.removeAll { $0 == subcategory }. Regarding what I was saying in the paragraph after the second block of code, I just meant that you can't unwrap the array like normal: if var subcategories = self.project.subcategories { subcategories.removeAll { $0 == subcategory } } and instead have to do this: if let subcategories = self.project.subcategories { self.project.subcategories?.removeAll { $0 == subcategory} } Just feels off to me.
Sep ’25
Reply to CoreText: Height of newline when added to CTTextFrame is too small
Anyone by chance ever experience this?
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to When I want to delete the application, I keep getting the following error. No one on the apple side is helping.
I have the same issue, submitted a ticket to dev support, haven't heard back in two weeks.
Replies
Boosts
Views
Activity
Jun ’23
Reply to How can you make a TextField update text with SwiftData / CloudKit?
@Claude31 Thanks I will try that out and report back.
Replies
Boosts
Views
Activity
Sep ’24
Reply to Mutating an array of model objects that is a child of a model object
@joadan What you're saying about an array being a value type even if it has reference types makes sense to me. What I'm a little confused about is that when I pass subcategories by reference in the sample project I have (i.e. passing it as a parameter to a struct where it's declared as var subcategories: [Subcategory], it still does update when I mutate the array using project.subcategories?.removeAll { $0 == subcategory }. Regarding what I was saying in the paragraph after the second block of code, I just meant that you can't unwrap the array like normal: if var subcategories = self.project.subcategories { subcategories.removeAll { $0 == subcategory } } and instead have to do this: if let subcategories = self.project.subcategories { self.project.subcategories?.removeAll { $0 == subcategory} } Just feels off to me.
Replies
Boosts
Views
Activity
Sep ’25
Reply to Mutating an array of model objects that is a child of a model object
@joadan but for self.project.subcategories?.removeAll { $0 == subcategory} you won't know if it didn't removeAll because subcategory didn't exist in the array, or if subcategories was nil to begin with because it didn't load from CloudKit / SwiftData.
Replies
Boosts
Views
Activity
Sep ’25
Reply to How to handle required @relationship optionals in SwiftData CloudKit?
@DTS Engineer Thanks for that. Just had one last question, when you say "if the other part of your app prefers to consume an empty array", what do you mean by that?
Replies
Boosts
Views
Activity
Oct ’25