Search results for

“SwiftData inheritance relationship”

4,986 results found

Post

Replies

Boosts

Views

Activity

Reply to Production Mac app becomes progressively unusable in Issues workspace; Mac_Dev remains fast
Here is more concrete context. Platform / tools Target: macOS app Language / frameworks: Swift, SwiftUI, SwiftData Cloud sync: SwiftData with CloudKit mirroring in the production configuration Xcode: 26.4 (17E192) Test OS: macOS 26.4 (25E246) What I’m seeing In the macOS app, issue board scrolling can become inconsistent or very slow. Changing an issue status from detail view can be very slow. Scrolling the status menu itself can be slow. Typing in issue description/notes fields can become sluggish. The problem is much more noticeable with my full production-sized dataset than with a small dev dataset. What I’ve tested so far I compared a small dev dataset vs a much larger production-sized dataset. With a small dataset, the same UI feels fast and smooth. With the large dataset, the same UI becomes noticeably slower. I also tested a local-only copy of the production dataset with CloudKit disabled. That improved some behavior, but it did not remove the lag entirely. When I reduced the local te
18h
Production Mac app becomes progressively unusable in Issues workspace; Mac_Dev remains fast
The production macOS build is showing severe performance problems, while Mac_Dev performs normally. Observed behavior in production Mac build: Issue board scrolling becomes inconsistent or nearly unusable Changing an issue status in detail view is very slow Scrolling the status menu/options can be slow Typing in issue description/notes fields becomes sluggish Dragging issues between milestones/statuses on the board can lag badly Observed behavior in Mac_Dev: Board scrolling is smooth Status changes are immediate Typing in description fields is responsive Drag/drop between milestones works well Important comparison: Mac_Dev appears to run against an isolated local SwiftData store Production Mac app uses the normal CloudKit-backed store Because the same UI is fast in Mac_Dev, this does not look like a pure rendering problem Most likely cause is production store / CloudKit sync churn amplifying existing SwiftUI invalidation and save behavior Current hypothesis: The production app is saving or observing
2
0
41
18h
Reply to Need MetricKit Implementation details for MacOS background Application, mainly for
[quote='882729022, PavanGulla, /thread/821002?answerId=882729022#882729022, /profile/PavanGulla'] we received approximately 48 hours of past metric payloads [/quote] Oh, interesting. I’m not 100% sure what’s going on here but this behaviour doesn’t surprise me. Internally, MetricKit uses an XPC activity to drive metric delivery [1], and XPC activities a very much a best effort kinda thing. [quote='882729022, PavanGulla, /thread/821002?answerId=882729022#882729022, /profile/PavanGulla'] could u comment if MetricKit works for NE Process? [/quote] Well, I think you have pretty solid evidence that it doesn’t (-: I’m going to talk about what’s going on in a sec, but before I do that I want to give you some concrete advice: If you want MetricKit to work in your NE system extension, I encourage you to file an enhancement request that describes your setup and why MetricKit is important to you. Once you’re done, please post your bug number here, just for the record. As to why this doesn’t work, consider this: % find /
20h
TestFlight build crashes from fetch descriptor
I have a FetchDescriptor that uses starts(with:) which works fine in debug builds but crashes in TestFlight and archive. For background information I'm using iCloud and model inheritance where the property being used in fetch descriptor is defined on the superclass, the fetch descriptor is for the subclass. Implementation: static func fetchDescriptor(nameStartingWith prefix: String) -> FetchDescriptor { let predicate = #Predicate { asset in asset.name.starts(with: prefix) } return FetchDescriptor(predicate: predicate) } @Model public class Asset: Identifiable { // MARK: - Properties var name: String = .... } @available(macOS 26.0, *) @Model public class ColorAsset: Asset { ... }
2
0
63
1d
Basic introduction to DEXT Matching and Loading
Note: This document is specifically focused on what happens after a DEXT has passed its initial code-signing checks. Code-signing issues are dealt with in other posts. Preliminary Guidance: Using and understanding DriverKit basically requires understanding IOKit, something which isn't entirely clear in our documentation. The good news here is that IOKit actually does have fairly good foundational documentation in the documentation archive. Here are a few of the documents I'd take a look at: IOKit Fundamentals IOKit Device Driver Design Guidelines Accessing Hardware From Applications Special mention to QA1075: Making sense of IOKit error codes,, which I happened to notice today and which documents the IOReturn error format (which is a bit weird on first review). Those documents do not cover the full DEXT loading process, but they are the foundation of how all of this actually works. Understanding the IOKitPersonalities Dictionary The first thing to understand here is that the IOKitPersonalities is called that
2
0
324
2d
SwiftData document-based app broken
Hello all Synopsis: document based SwiftData app breaks document handling after first save due to internal error saving the -shm file. Long: i am working on a small document based SwiftData app for macOS. The UI works well as long as the document was not saved. After saving the document and reopening it, I get an error consistently in console: BUG IN CLIENT OF libsqlite3.dylib: database integrity compromised by API violation: vnode unlinked while in use: /Users/vrunkel/Library/Containers/de.ecoobs.CurtailmentAnalyzer/Data/tmp/TemporaryItems/NSIRD_CurtailmentAnalyzer_mrXKMs/NewDocument/StoreContent-shm So somehow the -shm file is still referenced to NewDocument created when the app opens an untitled document and resides in the temporary folder. I have saved the document to my documents folder. After reopening and the above error deletion or addition of items crashes the app with a long backtrace to view updating: Modifications to the layout engine must not be performed from a background threa
9
0
2.5k
2d
Reply to My macOS app is unable to read a Managed Preferences plist unless the App Sandbox is disabled. Is there any solution to read the MDM plist file while the sandbox is still enabled?
Could you please suggest the recommended approach? First off, as a clarification, what are you actually trying read here? If this is your apps preference file (meaning, it has your apps bundle ID), then NSUserDefaults (or CFPreference) will read automatically without any special code. Similarly, if this ISN'T your apps data, then what's the relationship between your app and the data you're trying to read? __ Kevin Elliott DTS Engineer, CoreOS/Hardware
Topic: App & System Services SubTopic: Core OS Tags:
3d
NavigationLink selection in DisclosureGroup not working with .draggable modifier
NavigationLink selection in DisclosureGroup not working with .draggable modifier This was recently also posted here: https://stackoverflow.com/questions/79914290/ I am playing around with a tree data structure with folders and entries.I would like to add dragging of entries and folders between folders, using .draggable and dropDestination. In my current code, dragging works, but selection of entries no longer works, except if I click outside of the Text If I comment out .draggable(subfolder.name) in func FolderRow(), selection works as expected. How can I make sure both selection and drag and drop works for both folders and entries? I also tried using Transferable and Codable, but I get the same result. Here is an MRE: import SwiftData import SwiftUI @Model final class Folder { @Attribute(.unique) var name: String // Parent var parentFolder: Folder? // Child folders @Relationship(deleteRule: .cascade, inverse: Folder.parentFolder) var subfolders: [Folder] = [] // Leaf entries @Relationship
Topic: UI Frameworks SubTopic: SwiftUI
1
0
168
3d
MapKit in SwiftUI
Anyone worked with MapKit's MapCameraPosition in SwiftUI? I'm building a navigation app and ran into a limitation I can't find a clean solution for when using .userLocation(followsHeading: true) MapKit takes full control of the camera, smooth heading tracking, follows the user automatically. Perfect. But there's no way to set a custom pitch (tilt) on it. The only initializer available is... .userLocation(followsHeading: true, fallback: .automatic) No pitch, no distance parameters.... The workaround I found is setting .camera(MapCamera(..., pitch: 60)) first, waiting 200ms, then switching to .userLocation(followsHeading: true), MapKit inherits the pitch from the rendered camera state before handing off to user tracking.... It works, but it's clearly exploiting an undocumented behaviour in MapKit's state machine rather than a proper API Has anyone found a cleaner way to achieve this? Or is UIViewRepresentable wrapping MKMapView the only proper solution? It would be awesome to have something like this c
1
0
117
4d
CoreData + CloudKit -- Many-to-Many Relationship not Syncing
In an iOS App that uses CKShare I have a many-to-many relationship that does not consistently sync between the share's N participants. The relationship is between Group and Player as group.players and player.groups. As an example, given 3 group each with 4 players (aka 4:4:4), some devices show CoreData (it is NOT a UI issue) with 4:2:3 or 3:4:4. (A deletion of CoreData from a device, forcing a full re-sync from CloudKit, seems to populate the group:player relationships consistently; but obviously that is impractical to resolving the issue). How do I avoid these sync-from-CloudKit inconsistencies? Note: AI agents generally suggest adding a CoreData 'join' entity - such as 'GroupPlayer'. Is that THE fix?
1
0
72
1w
Reply to CoreData + CloudKit -- Many-to-Many Relationship not Syncing
This sounds like a general synchronization issue, and so you can probably start with the technotes mentioned in this post to hopefully figure out the cause of the issue. NSPersistentCloudKitContainer supports many-to-many relationships. Before seeing an evidence that proves it doesn't work (by going through the debugging process the technotes describe), I probably won't change the Core Data model. Best, —— Ziqiao Chen  Worldwide Developer Relations.
1w
Reply to App Store Connect Screenshot Upload Stuck in “Processing” State – Blocking Submission Completely
alam333, I don’t see any relationship between your issue and the one being reported by DarrenHan. And regarding your issue, let’s focus that discussion on this thread, which you’ve already posted on. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
1w
Reply to iCloud Sync not working with iPhone, works fine for Mac.
-It is the iPhone not receiving the notification to update. Steps to reproduce Change property on Mac iPhone app is active, no changes received (even after 2 hours) Swipe to home screen on iPhone open iPhone app SwiftData syncs on iPhone and shows changes that were made on the Mac (Again, this worked 48 hours ago, and the only change that was made was updating all devices to iOS26.4)
1w
Reply to Production Mac app becomes progressively unusable in Issues workspace; Mac_Dev remains fast
Here is more concrete context. Platform / tools Target: macOS app Language / frameworks: Swift, SwiftUI, SwiftData Cloud sync: SwiftData with CloudKit mirroring in the production configuration Xcode: 26.4 (17E192) Test OS: macOS 26.4 (25E246) What I’m seeing In the macOS app, issue board scrolling can become inconsistent or very slow. Changing an issue status from detail view can be very slow. Scrolling the status menu itself can be slow. Typing in issue description/notes fields can become sluggish. The problem is much more noticeable with my full production-sized dataset than with a small dev dataset. What I’ve tested so far I compared a small dev dataset vs a much larger production-sized dataset. With a small dataset, the same UI feels fast and smooth. With the large dataset, the same UI becomes noticeably slower. I also tested a local-only copy of the production dataset with CloudKit disabled. That improved some behavior, but it did not remove the lag entirely. When I reduced the local te
Replies
Boosts
Views
Activity
18h
Production Mac app becomes progressively unusable in Issues workspace; Mac_Dev remains fast
The production macOS build is showing severe performance problems, while Mac_Dev performs normally. Observed behavior in production Mac build: Issue board scrolling becomes inconsistent or nearly unusable Changing an issue status in detail view is very slow Scrolling the status menu/options can be slow Typing in issue description/notes fields becomes sluggish Dragging issues between milestones/statuses on the board can lag badly Observed behavior in Mac_Dev: Board scrolling is smooth Status changes are immediate Typing in description fields is responsive Drag/drop between milestones works well Important comparison: Mac_Dev appears to run against an isolated local SwiftData store Production Mac app uses the normal CloudKit-backed store Because the same UI is fast in Mac_Dev, this does not look like a pure rendering problem Most likely cause is production store / CloudKit sync churn amplifying existing SwiftUI invalidation and save behavior Current hypothesis: The production app is saving or observing
Replies
2
Boosts
0
Views
41
Activity
18h
Reply to Need MetricKit Implementation details for MacOS background Application, mainly for
[quote='882729022, PavanGulla, /thread/821002?answerId=882729022#882729022, /profile/PavanGulla'] we received approximately 48 hours of past metric payloads [/quote] Oh, interesting. I’m not 100% sure what’s going on here but this behaviour doesn’t surprise me. Internally, MetricKit uses an XPC activity to drive metric delivery [1], and XPC activities a very much a best effort kinda thing. [quote='882729022, PavanGulla, /thread/821002?answerId=882729022#882729022, /profile/PavanGulla'] could u comment if MetricKit works for NE Process? [/quote] Well, I think you have pretty solid evidence that it doesn’t (-: I’m going to talk about what’s going on in a sec, but before I do that I want to give you some concrete advice: If you want MetricKit to work in your NE system extension, I encourage you to file an enhancement request that describes your setup and why MetricKit is important to you. Once you’re done, please post your bug number here, just for the record. As to why this doesn’t work, consider this: % find /
Replies
Boosts
Views
Activity
20h
TestFlight build crashes from fetch descriptor
I have a FetchDescriptor that uses starts(with:) which works fine in debug builds but crashes in TestFlight and archive. For background information I'm using iCloud and model inheritance where the property being used in fetch descriptor is defined on the superclass, the fetch descriptor is for the subclass. Implementation: static func fetchDescriptor(nameStartingWith prefix: String) -> FetchDescriptor { let predicate = #Predicate { asset in asset.name.starts(with: prefix) } return FetchDescriptor(predicate: predicate) } @Model public class Asset: Identifiable { // MARK: - Properties var name: String = .... } @available(macOS 26.0, *) @Model public class ColorAsset: Asset { ... }
Replies
2
Boosts
0
Views
63
Activity
1d
Basic introduction to DEXT Matching and Loading
Note: This document is specifically focused on what happens after a DEXT has passed its initial code-signing checks. Code-signing issues are dealt with in other posts. Preliminary Guidance: Using and understanding DriverKit basically requires understanding IOKit, something which isn't entirely clear in our documentation. The good news here is that IOKit actually does have fairly good foundational documentation in the documentation archive. Here are a few of the documents I'd take a look at: IOKit Fundamentals IOKit Device Driver Design Guidelines Accessing Hardware From Applications Special mention to QA1075: Making sense of IOKit error codes,, which I happened to notice today and which documents the IOReturn error format (which is a bit weird on first review). Those documents do not cover the full DEXT loading process, but they are the foundation of how all of this actually works. Understanding the IOKitPersonalities Dictionary The first thing to understand here is that the IOKitPersonalities is called that
Replies
2
Boosts
0
Views
324
Activity
2d
SwiftData document-based app broken
Hello all Synopsis: document based SwiftData app breaks document handling after first save due to internal error saving the -shm file. Long: i am working on a small document based SwiftData app for macOS. The UI works well as long as the document was not saved. After saving the document and reopening it, I get an error consistently in console: BUG IN CLIENT OF libsqlite3.dylib: database integrity compromised by API violation: vnode unlinked while in use: /Users/vrunkel/Library/Containers/de.ecoobs.CurtailmentAnalyzer/Data/tmp/TemporaryItems/NSIRD_CurtailmentAnalyzer_mrXKMs/NewDocument/StoreContent-shm So somehow the -shm file is still referenced to NewDocument created when the app opens an untitled document and resides in the temporary folder. I have saved the document to my documents folder. After reopening and the above error deletion or addition of items crashes the app with a long backtrace to view updating: Modifications to the layout engine must not be performed from a background threa
Replies
9
Boosts
0
Views
2.5k
Activity
2d
Reply to My macOS app is unable to read a Managed Preferences plist unless the App Sandbox is disabled. Is there any solution to read the MDM plist file while the sandbox is still enabled?
Could you please suggest the recommended approach? First off, as a clarification, what are you actually trying read here? If this is your apps preference file (meaning, it has your apps bundle ID), then NSUserDefaults (or CFPreference) will read automatically without any special code. Similarly, if this ISN'T your apps data, then what's the relationship between your app and the data you're trying to read? __ Kevin Elliott DTS Engineer, CoreOS/Hardware
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
3d
Reply to iCloud Sync not working with iPhone, works fine for Mac.
I just updated my iPhone to 26.5 beta. The syncing is now working on the iPhone. I have Mac, AppleTV and iPhone all running at the same time, and any change to SwiftData on any of the 3 devices immediately updates on the other 2.
Replies
Boosts
Views
Activity
3d
NavigationLink selection in DisclosureGroup not working with .draggable modifier
NavigationLink selection in DisclosureGroup not working with .draggable modifier This was recently also posted here: https://stackoverflow.com/questions/79914290/ I am playing around with a tree data structure with folders and entries.I would like to add dragging of entries and folders between folders, using .draggable and dropDestination. In my current code, dragging works, but selection of entries no longer works, except if I click outside of the Text If I comment out .draggable(subfolder.name) in func FolderRow(), selection works as expected. How can I make sure both selection and drag and drop works for both folders and entries? I also tried using Transferable and Codable, but I get the same result. Here is an MRE: import SwiftData import SwiftUI @Model final class Folder { @Attribute(.unique) var name: String // Parent var parentFolder: Folder? // Child folders @Relationship(deleteRule: .cascade, inverse: Folder.parentFolder) var subfolders: [Folder] = [] // Leaf entries @Relationship
Topic: UI Frameworks SubTopic: SwiftUI
Replies
1
Boosts
0
Views
168
Activity
3d
MapKit in SwiftUI
Anyone worked with MapKit's MapCameraPosition in SwiftUI? I'm building a navigation app and ran into a limitation I can't find a clean solution for when using .userLocation(followsHeading: true) MapKit takes full control of the camera, smooth heading tracking, follows the user automatically. Perfect. But there's no way to set a custom pitch (tilt) on it. The only initializer available is... .userLocation(followsHeading: true, fallback: .automatic) No pitch, no distance parameters.... The workaround I found is setting .camera(MapCamera(..., pitch: 60)) first, waiting 200ms, then switching to .userLocation(followsHeading: true), MapKit inherits the pitch from the rendered camera state before handing off to user tracking.... It works, but it's clearly exploiting an undocumented behaviour in MapKit's state machine rather than a proper API Has anyone found a cleaner way to achieve this? Or is UIViewRepresentable wrapping MKMapView the only proper solution? It would be awesome to have something like this c
Replies
1
Boosts
0
Views
117
Activity
4d
Choosing Minimum Deployment Targets
My app uses SwiftData so I need at least iOS 17 as the minimum deployment target. When I select iOS 17 in the dropdown it selects iOS 17.6 as the target. However, the newest simulator available is iOS 17.5. Should I set my minimum deployment target to 17.0, 17.5, 17.6, or something else?
Replies
3
Boosts
0
Views
73
Activity
5d
CoreData + CloudKit -- Many-to-Many Relationship not Syncing
In an iOS App that uses CKShare I have a many-to-many relationship that does not consistently sync between the share's N participants. The relationship is between Group and Player as group.players and player.groups. As an example, given 3 group each with 4 players (aka 4:4:4), some devices show CoreData (it is NOT a UI issue) with 4:2:3 or 3:4:4. (A deletion of CoreData from a device, forcing a full re-sync from CloudKit, seems to populate the group:player relationships consistently; but obviously that is impractical to resolving the issue). How do I avoid these sync-from-CloudKit inconsistencies? Note: AI agents generally suggest adding a CoreData 'join' entity - such as 'GroupPlayer'. Is that THE fix?
Replies
1
Boosts
0
Views
72
Activity
1w
Reply to CoreData + CloudKit -- Many-to-Many Relationship not Syncing
This sounds like a general synchronization issue, and so you can probably start with the technotes mentioned in this post to hopefully figure out the cause of the issue. NSPersistentCloudKitContainer supports many-to-many relationships. Before seeing an evidence that proves it doesn't work (by going through the debugging process the technotes describe), I probably won't change the Core Data model. Best, —— Ziqiao Chen  Worldwide Developer Relations.
Replies
Boosts
Views
Activity
1w
Reply to App Store Connect Screenshot Upload Stuck in “Processing” State – Blocking Submission Completely
alam333, I don’t see any relationship between your issue and the one being reported by DarrenHan. And regarding your issue, let’s focus that discussion on this thread, which you’ve already posted on. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Replies
Boosts
Views
Activity
1w
Reply to iCloud Sync not working with iPhone, works fine for Mac.
-It is the iPhone not receiving the notification to update. Steps to reproduce Change property on Mac iPhone app is active, no changes received (even after 2 hours) Swipe to home screen on iPhone open iPhone app SwiftData syncs on iPhone and shows changes that were made on the Mac (Again, this worked 48 hours ago, and the only change that was made was updating all devices to iOS26.4)
Replies
Boosts
Views
Activity
1w