I use a custom CollectionViewCell in my Storyboard. When I start the app I get this message:
Could not cast value of type \'UICollectionViewCell\' to T
I face this problem , because in the viewDidLoad()
I registered my cell with UICollectionViewCell class . In my cellForItemAtIndexPath
used CustomSubcalssCollectionViewCell for dequeueReusableCell.
make sure registerClass and dequeueReusableCell are the same class solve the problem
self.registerClass(SomeUICollectionCellClass.self, forCellWithReuseIdentifier: reuseIdentifier)
let cell = collectionView.dequeueReusableCellWithReuseIdentifier(reuseIdentifier, forIndexPath: indexPath) as! SomeUICollectionCellClass