Is there any way to use outline disclosure sections in a UICollectionViewDiffableDataSource without having to make all apply(_ snapshot:) calls from the main thread?
Whenever I collapse or expand a section I get a warning about mixing main queue/off-main queue updates:
Warning: applying updates in a non-thread confined manner is dangerous and can lead to deadlocks. Please always submit updates either always on the main queue or always off the main queue
I understand what this means, but I am applying my section snapshots on a background queue to avoid interrupting the UI, it seems like the expand/collapse updates use the main queue and I cannot find any way to make it use the same queue as my other updates. Does this mean I must apply my own updates on the main queue now as well?
Post
Replies
Boosts
Views
Activity
Is it possible to build a SwiftUI app on macOS 11 that uses new APIs in macOS 12? I have tried using an #availability check to only use the new APIs on macOS 12, but am getting a crash saying 'symbol not found' when running that app on macOS 11. Do I need to develop on macOS 12?
How do I (can I?) use query generations to prevent Core Data from modifying the view context while importing new objects in the background, whilst keeping existing objects modifiable? I want to avoid every insert or delete from triggering UITableView updates until I am ready, but at the same time I want objects that are already in Core Data and being displayed by a UITableView to be able to be modified and have only those changes reflected in the view context, is there any way to do this?
How do I get decent left alignment within expanded outline sections in a sidebar on mac catalyst/Big Sur? The outline disclosure accessory is placed on the leading edge for 2nd level rows, pushing the row icon in to the right a little, when you expand the section the child rows are indented, but not enough due to the width of the outline accessory itself, leading to child icons being slightly further to the left. On iOS this isn't an issue because the outline chevron is placed on the trailing edge.
I am having difficulty in getting acceptable performance when trying to use UICollectionViewDiffableDataSource in conjunction with a NSFetchedResultsController when the number of fetched objects is large (8000+). In comparison to using the NSFetchedResultsController directly as the data source, using a diffable data source and populating it with a snapshot in controller(_ :, didChangeContentWith:) is very slow.
I have set my fetch request to a small batch size (20), the same exact fetch request populates the collection view almost instantly when using the NSFetchedResultsController as the data source via the usual collection view data source methods.
What is the recommended approach to allowing a user to delete all the data they have in their Core Data store plus all the data mirrored to CloudKit via NSPersistentCloudKitContainer? How would such a technique work with multiple devices?
Is there any way to force NSPersistentCloudKitContainer to do a full sync?
Is there any method to receive a notification or callback when NSPersistentCloudKitContainer begins and ends a batch of sync operations? I'd like to be able to show some sort of sync progress in my UI.