The goal is to dequeue cell like
let cell = CustomCollectionViewCell.dequeueReusable(collectionView, for: indexPath)
I'm trying like
class func dequeueReusable<T: UICollectionViewCell>(_ collectionView: UICollectionView, for indexPath: IndexPath) -> T {
return collectionView.dequeueReusableCell(withReuseIdentifier: self.reuseID, for: indexPath) as! T
}
But it returns UICollectionViewCell, not CustomCollectionViewCell.
How to achieve this?