Questions tagged [uitableviewdiffabledatasource]

30 questions
0
votes
1 answer

swift Diffable data source error - 'Fatal: supplied item identifiers are not unique. Duplicate identifiers:

I think there is a problem with the calendar model or the data I put in the pile, but I can't find it no matter how much I look for it. I'm desperate for help The contents of the error are as follows *** Terminating app due to uncaught exception…
0
votes
0 answers

How can we implement didEndDisplayingCell with UITableviewDiffabledatasource or relevent

How can we implement didEndDisplayingCell with UITableviewDiffabledatasource or with using diffable datasource how we know that the cell is dealloc? What is want is the currently I'm using UItableViewDiffableDaasource for tableview and I want to…
Vvk
  • 4,031
  • 29
  • 51
0
votes
0 answers

UITableViewDiffableDataSource re-rendering unnecessarily on iOS 14

I have a swift project, with a UITableView that's populated by a UITableViewDiffableDataSource. In my model struct, I've implemented the hash() function, roughly like this: func hash(into hasher: inout Hasher) { hasher.combine(self.id) …
Avi Sasson
  • 666
  • 7
  • 22
0
votes
0 answers

How to call/set delegate methods when using UITableViewDiffableDataSource

I have this code: class CreateSkillGroupViewController: UIViewController { var skillsDataSource: SkillsInGroupDataSource! = nil var skillsTableView: UITableView! override func viewDidLoad() { super.viewDidLoad() …
BigBoy1337
  • 4,735
  • 16
  • 70
  • 138
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

UITableView does not load the new state if user scrolling

SOLVED: It is not about UITableViewDiffableDataSource. The problem was accessing realm from 2 different thread sequentially and not getting consistent result One of the thread was main thread and scrolling somehow kept main thread busy and triggered…
metinn
  • 116
  • 1
  • 7
0
votes
0 answers

Moving/Deleting Diffable TableView Rows

I am trying to update a tableView to UITableViewDiffableDataSource but I am having trouble with being able to delete/move the rows. With some help from a previous question, I have subclassed the dataSource and added the tableview overrides there. …
0
votes
1 answer

What is a good approach to sharing a data model between a table/collection view controller and its associated diffable data source subclass?

I have a UITableViewController with a model property declared in it. When migrating from UITableViewDataSource protocol conformance to a subclass of UITableViewDiffableDataSource outside of the table view controller, the model is no longer…
Curiosity
  • 544
  • 1
  • 15
  • 29
0
votes
2 answers

SWIFT: Communicating data from ViewController where tableView is defined to tableViewCell

I have programmatically implemented a tableView inside a viewController: class MoviesViewController5: UIViewController { let tableView = UITableView() // There's a code responsible for populating this array var moviesItemsArray…
AG_HIHI
  • 1,705
  • 5
  • 27
  • 69
0
votes
1 answer

self sizing cell with uitableviewdiffabledatasource

I have a detail ViewController whoose cells are defined by a custom uitableviewdiffabledata like this: { (_, indexPath, item) -> UITableViewCell? in let color = UIColor(named: "blue")! if let _ = item as? TextFieldItem, let…
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

UITableViewDiffableDataSource and UICollectionViewDiffableDataSource working different when class vs struct is used

I noticed, when using UITableViewDiffableDataSource / UICollectionViewDiffableDataSource, the ItemIdentifierType when using var managedDataSource: UITableViewDiffableDataSource! class StringCellObject: Hashable { let…
-1
votes
1 answer

Cells are not populating using UITableViewDiffableDataSource in UIViewController

My code was working before I change the subclass from UITableViewController to UIViewController. Reason for switching is I need to add a collectionView on top of my tableView. But now the cells are not populating. The snapshot is still being called…
Dreiohc
  • 317
  • 2
  • 12
-1
votes
4 answers

UITableViewDiffableDataSouce: Invalid update: invalid number of sections

I am trying to apply an empty snapshot, it's crashing my app. I have been trying to debug it for 2 days now and can't seem to figure out a way to resolve this issue. Below is the code I am running: // // ItemsListDiffableVC.swift // …
Vandan Patel
  • 1,012
  • 1
  • 12
  • 23
-2
votes
1 answer

UITableViewDelegate doesn't work with UITableViewDiffableDataSource

I created test project to reproduce the issue https://github.com/msnazarow/DiffarableTest Simply you need to pass several steps Create new target Create Base class that inherit UITableViewDiffableDataSource and also UITableViewDelegate but do not…
1
2