I create a collection, and made my own customCell. I indicated this in the identity inspector, and as far as I can tell, I did everything right.
The code
import UIKit
class SubjectCollectionViewCell: UICollectionViewCell {
@IBOutlet weak var imageView: UIImageView!
@IBOutlet weak var label: UILabel!
}
and in my collection ViewController
override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCellWithReuseIdentifier(reuseIdentifier, forIndexPath: indexPath) as! SubjectCollectionViewCell
return cell
}
The following error message appears
"Cannot pass a value of type 'UICollectionViewCell' (0x110460820) to 'project.SubjectCollectionViewCell' (0x10eceeda0). (Lldb)"
source
share