Post

Replies

Boosts

Views

Activity

Reply to SwiftUI OutlineGroup Customizing
Late to the game, but it looks like you could achieve A and B with a custom DisclosureGroupStyle introduced in OS 16.0/macOS 13.0 (see example on linked page). FYI: In my case, I was loading recursive data into a List using the following code (excerpt) List(data, children: \.children) {node in } Here, I had to add .disclosureGroupStyle(MyDisclosureStyle()) twice, to the List itself as well as to its parent view to get it working for all nested levels (and not only the the first level).
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’22
Reply to ContextMenu of List stops working when applying custom DisclosureGroupStyle in macOS
I figured it out (after having tried for several days before posting this question...): When .contentShape(Rectangle()) is removed, the contextMenu works again in macOS as well. However, with this, the user cannot expand/collapse items by clicking on the item itself anymore (which, luckily, this isn't an issue in my case clicking an item should select/unselect it). Given the above-mentioned .contentShape(Rectangle()) is also included in Apple's official DisclosureGroupStyle example and given that contextMenu is only invoked by right clicks, thus, left klicks should still be possible, I'd say this behaviour can be considered a bug.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’22
Reply to CloudKit sync stopped working with error „You can't save and delete the same record"
Thanks for the reply! Firstly, correct, we're using CoreData + CloudKit and "mirrored relationships" means "reflexive relationships" (e.g., Article.similarArticles whereby both are of the type Article). Assuming that you are using Data + CloudKit, I am guessing that this can be triggered by your code and data. Regrettably, that doesn't seem to be the case, also given the Delete Rule is "Nullify". Digging through our old messages, we found out that we had already reported this very same issue a couple of years ago with a similar data model but where no entity was ever deleted. At that time we filed feedback report 9118745 and we were told that this was likely a bug. it is worth filing a feedback report for the Core Data team Given this seems to be the very same issue, I’ve added the information of this post to our above ticket (and have provided the relevant system diagnose logs, data model, etc. there too). Does your Core Data model indeed has the reflexive relationship? If yes, has it been there for long time, or did you add that recently before you saw the error? Yes, we've added this reflexive relationship to a completely new project/iCloud container in 2024 and the reflexive relationship indeed synced, however, not in all instances. So it looks like NSPersistentCloudKitContainer indeed supports reflexive relationships, but is somehow confused and fails only in certain instances. Many thanks
Jan ’25