Closed cylak closed 6 years ago
Sorry my bad, I found it!
GLTableCollectionViewController.swift -> line 117
guard let indexedCollectionView: GLIndexedCollectionView = collectionView as? GLIndexedCollectionView else {
fatalError("UICollectionView must be of GLIndexedCollectionView type")
}
if indexedCollectionView.indexPath.section % 2 == 0 {
guard let cell: GLIndexedCollectionViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: GLIndexedCollectionViewCell.identifier, for: indexPath) as? GLIndexedCollectionViewCell else {
fatalError("UICollectionViewCell must be of GLIndexedCollectionViewCell type")
}
cell.backgroundColor = UIColor(hue: CGFloat(indexPath.item) / 20.0, saturation: 0.8, brightness: 0.9, alpha: 1)
return cell
}
else{
guard let cell: GameCell = collectionView.dequeueReusableCell(withReuseIdentifier: GameCell.id, for: indexPath) as? GameCell else {
fatalError("UICollectionViewCell must be of GLIndexedCollectionViewCell type")
}
return cell
}
I want to use more than one UICollectionViewCell in the table view
Description:
I want to use more than one UICollectionViewCell in the table view but get fatal error like the custom cell didn't registered! It works just with one view cell (default cell or custom cell) but if i want to use mixed of these i got error. Thanks for your help 👍
Expected Behavior:
Show default cell with custom new cell
Actual Behavior:
Fatal error
Steps to Reproduce:
Custom cell -> GameCell.swift
GLCollectionTableViewCell.swift -> line 147
collectionView.register(GameCell.self, forCellWithReuseIdentifier: GameCell.id)
GLTableCollectionViewController.swift -> line 117
Your Environment: