Could not cast value of type ‘YZApp.CartViewCell’ (0x107340830) to ‘YZApp.CartDetailViewCell’ (0x107340ba0).

// having problem in cv.register(CartDetailViewCell.self, forCellWithReuseIdentifier: “cellId”)
or
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCel
l {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: “cellId”, for: indexPath) as! CartDetailViewCell
}
or
Check in storyBoard cell Identifier = “cellId”.