I was wondering to check how to set the height of tableview cell while using DiffableDataSource. This is code:
func configureDataSource() {
dataSource = MenuItemDataSource(tableView: MenuItemTablevVew, cellProvider: { (tableView, indexPath, menuItem) -> UITableViewCell? in
guard let cell = tableView.dequeueReusableCell(withIdentifier: self.cellIdentifier) as? MenuItemTableCell else { fatalError("Cell not exists")
}
cell.data = menuItem
return cell
})
}
func createSnapshot(menuItems: [MenuItemModel]) {
var snapshot = MenuItemSnapshot()
snapshot.appendSections([.First])
snapshot.appendItems(menuItems)
dataSource.apply(snapshot, animatingDifferences: false)
}