Post

Replies

Boosts

Views

Activity

Specify queue for collapse/expand of section snapshots
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?
2
0
473
Jun ’24
How do I use query generation to prevent Core Data from modifying the view context while importing new objects in the background, whilst keeping existing objects modifiable?
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?
0
0
531
Jun ’21
Catalyst outline sidebar icons not aligning within expanded section
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.
0
0
387
Aug ’20
Performance when using UICollectionViewDiffableDataSource in conjunction with NSFetchedResultsController
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.
3
0
1.5k
Jun ’20