Questions tagged [nsdiffabledatasourcesnapshot]

44 questions
0
votes
0 answers

dataSource.snapshot().itemIdentifiers(inSection:) works extremely inefficient

Consider an app that uses UICollectionViewDiffableDataSource for the data source of UICollectionView. private func makeDataSource() -> DataSource { return DataSource(collectionView: collectionView) { collectionView, indexPath, task in …
0
votes
0 answers

iOS Crash Crashed: com.apple.main-thread EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000

I have received the following crash log from Firebase Crashlytics but could not identify the exact reason. It's happing on iOS devices having os version above 15.0. I am using DiffableDataSource for loading collection view and table view. Crashed:…
0
votes
1 answer

NSDiffableDataSourceSectionSnapshot reload items or the whole section

When you have a NSDiffableDataSourceSnapshot you can perform a reload on any section/item. Whereas when you have a NSDiffableDataSourceSectionSnapshot I can't do any reload. I would like to refresh a specific item because after creating the…
Godfather
  • 4,040
  • 6
  • 43
  • 70
0
votes
2 answers

NSDiffableDataSource - the cellProvider on my CollectionView Data Source is not being called?

I have a data source like so fileprivate func makeRecordsDataSource() -> RecordsDataSource { let dataSource = RecordsDataSource( collectionView: recordsCollectionView, cellProvider: { (collectionView, indexPath,…
0
votes
0 answers

Collectionview inside collectionview cell causes flickering while scroll

I have collectionview with multiple section and vertical scrolling. Each have only one item. Screen flow is like below: I call an api which provides me feedId and url for to fetch section data. When user scrolls collectionview api gets called for…
0
votes
1 answer

DiffableDataSource does not update properly after applying changes in snapshot

I'm trying to filter a list of users in a TableViewDiffableDataSource. The filtered array of users is passed to the following function: private func updateUserCell(_ users: Users? = nil) { guard let newUsers = users else { …
0
votes
1 answer

Is applying NSDiffableDataSourceSnapshot broken?

I have a problem with applying NSDiffableDataSourceSnapshot to UICollectionViewDiffableDataSource. Imagine this situation: I have two items and I want to remove the second one and also I want to reload all other items in that section. I do it like…
0
votes
0 answers

How to update realm with diffabledatasource?

I'm new to realm and trying to implement realm with UICollectionViewDiffableDataSource. However, I'm finding it difficult to update the data source after inserting / deleting a new object. I tried to update with NotificationToken but it crashes.…
0
votes
0 answers

Swift - What is the difference between implementing Hashable and Equatable and NSObject hash and isEqual overrides

I'm trying to wrap my head around the new DiffableDataSource way of handling data in tableviews/collectionviews and during testing I came across a strange crash. I would expect that the two implementations below would work exactly the…
L3M0L
  • 429
  • 8
  • 23
0
votes
1 answer

How do I open the first cell in Modern Collection Views programmatically?

Playing around with Modern Collection Views, I managed to create a custom UIContentView. Great. Now I would like to open the first cell/row programmatically. How do I go about doing that? This is what I would like to see on startup. Thanks in…
0
votes
1 answer

Applying NSDiffableDataSourceSnapshot to UITableViewDiffableDataSource cause 'NSInternalInconsistencyException'

I am trying to implement a UITableViewViewDiffableDataSource for my tableview. My code compiles fine, however I keep running into this error the first time I apply a snapshot to it, with the following error: Terminating app due to uncaught…
0
votes
0 answers

How to handle CRUD operation with Diffable Data Source & NSFetchedResultsController

I have a simple product store screen of 4 rows with each row containing 4-5 products. Currently I have the following setup Controller calls the backend server and gets the data Save the models to Core Data This triggers an update of…
0
votes
1 answer

UITableViewDiffableDataSource and NSDiffableDataSourceSnapshot for different objects shows only one row

I've implemented UITableView using UITableViewDiffableDataSource and NSDiffableDataSourceSnapshot like private typealias ListDataSource = UITableViewDiffableDataSource private typealias ListSnapshot =…
0
votes
1 answer

CellProvider Closure never gets executed for UICollectionViewDiffableDataSource

class PropertyCollViewController: UIViewController { @IBOutlet weak var collectionView: UICollectionView! var sections = Person.getSectionData() typealias PropertyDataSource = UICollectionViewDiffableDataSource
1 2
3