Questions tagged [diffabledatasource]
92 questions
3
votes
0 answers
Custom Collection View layout: 'Invalid parameter not satisfying: self.supplementaryViewProvider'
I am using two collectionViews in my view controller. 1 has a custom layout and custom attributes for its supplementary views.
Here is the view controller:
class ProgressViewController: UIViewController {
private lazy var data = fetchData()
…

BigBoy1337
- 4,735
- 16
- 70
- 138
3
votes
2 answers
Diffable Data Source - Reload Header
What are the ways in which a UICollectionViewDiffableDataSource header can be reloaded?
I have a collection view with a header that displays user details, and rows that display posts, the model is
struct PostUser {
var user: User
var post:…

mickeysox
- 159
- 2
- 14
3
votes
2 answers
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Fatal: supplied identifiers are not unique.' ***
Hello everyone ♂️I'm parsing the following JSON to a UITableView using a UITableViewDiffableDataSource for nice searching animations.
The JSON : https://www.pathofexile.com/api/trade/data/items
And here's the repo :…

Laurent
- 83
- 1
- 1
- 6
3
votes
2 answers
How to add Header Name in UITableViewDiffableDataSource
I try to add header title for each section in UITableView, but in this case it's UITableViewDiffableDataSource and I don't have any idea where I should do that. A part of my code:
private func prepareTableView() {
tableView.delegate = self
…

PiterPan
- 1,760
- 2
- 22
- 43
2
votes
1 answer
How to stop UICollectionViewDiffableDataSource to scroll the collection view while we apply snapshot?
Is there any way that I can make UICollectionViewDiffableDataSource stop scrolling collection view while we apply snapshot?
I am using this library: https://github.com/ra1028/DiffableDataSources
I have a situation where I want to keep the collection…

Gaurav Parvadiya
- 149
- 2
- 11
2
votes
0 answers
How to push DiffableDataSourceSnapshot update inside main thread?
Im new to UITableViewDiffableDataSource,
When I prepare the DiffableDataSourceSnapshot and apply? I can see that update is triggering from Dispatch queue: com.apple.uikit.datasource.diffing Im expecting all UI operations has to be in the…

Rajasekhar Pasupuleti
- 1,598
- 15
- 22
2
votes
0 answers
NSDiffableSnapshot causes collectionview's cell registration to be re-called even without any changes to the data
I have a problem with NSDiffableDataSource. I have created this basic example containing a UICollectionView with a single item showing a random number:
import UIKit
class ViewController: UIViewController {
enum Section {
case main
…

SwiftedMind
- 3,701
- 3
- 29
- 63
2
votes
1 answer
UICollectionViewDiffableDataSource optional sections
I'm trying to implement a collection view with the diffable data source. I have some optional advertisment which I would like to put in a separate section of the collection view (for specific layouting etc.). My sections look like this:
enum…

lawicko
- 7,246
- 3
- 37
- 49
2
votes
1 answer
Crash number of items in section 0 when there are only 0 sections in the collection view
I want to learn using UICollectionViewDiffableDataSource using Pinterest Layout, but when I try to running my simulator. it crash and give me a message
request for number of items in section 0 when there are only 0 sections in the collection…

ferryawijayanto
- 569
- 4
- 18
2
votes
0 answers
UICollectionView selection and delete issue with diffable data sources
I'm at my wits end here, but I have a weird issue with my collectionview and trying to select multiple items. I have an edit button, that when I hit it it triggers an isEditing function. When a cell is tapped, it changes the bool on isSelected.…

Frank Foster
- 139
- 9
2
votes
2 answers
NFetchedResultsController delegate method didChangeContentWith is not called when deleted an item using UIDIffableDataSource tableview
I am trying to implement my existing coredata project using the UITableViewDiffableDataSource. My tableview is coupled using the NSFetchedResultsController and the corresponding delegate methods.
I am able to list the data in the tableview using…

Arun Kumar
- 454
- 9
- 19
1
vote
0 answers
Passing UIView to Reusable cell using UIContentConfiguration and UIContentView
I am trying to add a UIView programatically to a UIContentView, using the UIContentConfiguration. In the configure method I add the custom view as a Subview. I also keep a weak reference to it so I can remove it if the configuration says so. But for…

Tudor Neagu
- 11
- 2
1
vote
0 answers
Diffable Data Source With Multiple Sections And Objects
I have a Data Source with multiple sections and objects. When creating my Data Source I can only access the section or the item type. I need to access both, is there a cleaner way to do this? My model is below;
enum BrowseSectionType: Hashable {
…

David Henry
- 1,972
- 20
- 43
1
vote
0 answers
Is the Diffable DataSource queue created on whatever thread it we created the datasource on?
I'm trying to understand diffabledata source threading in more detail.
In my code I create a diffable data source on the main thread.
This data source uses a backing storing.
The data for the backing store comes from the following getter method.
…

dubbeat
- 7,706
- 18
- 70
- 122
1
vote
1 answer
how to resolve DiffableDataSource mulipleCell crash (iOS 13)
I encountered an error during development.
The minimum target is iOS 13.
You want to give different cells for each section using DiffableDataSource.
I don't know why there's an error.
I need your help.
minumum target: iOS 13.0 *
errorCode
Thread…

iOS-Dev-Junior
- 33
- 3