I have name the table view cell identifier as cell still keep crashing. Restart XCODE and restart MacBook several times still not working.
func collectionView( collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath) as! ImageCollectionViewCell
if itemImages.count > 0 {
cell.setupImageWith(itemImage: itemImages[indexPath.row])
}
return cell
}
***********
2020-06-23 08:52:56.579198+0800 MarketPlaceDev[7650:1771105] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'could not dequeue a view of kind: UICollectionElementKindCell with identifier cell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard'
* First throw call stack:
********** Codes******
func collectionView( collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath) as! ImageCollectionViewCell
if itemImages.count > 0 {
cell.setupImageWith(itemImage: itemImages[indexPath.row])
}
return cell
}
***********
********** Crash Error******
2020-06-23 08:52:56.579198+0800 MarketPlaceDev[7650:1771105] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'could not dequeue a view of kind: UICollectionElementKindCell with identifier cell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard'
* First throw call stack: