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 TestProject.CollectionViewCell.
The template for a CollectionViewController in Xcode comes with this line of code in viewDidLoad, which changes the specification in your storyboard.
// Register cell classes self.collectionView!.register(UICollectionViewCell.self, forCellWithReuseIdentifier: reuseIdentifier)
Simply delete that line.
In older Swift versions the line is:
// Register cell classes self.collectionView!.registerClass(UICollectionViewCell.self, forCellWithReuseIdentifier: reuseIdentifier)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With