I am using a NIB file to build my custom collection view cell. The File Owner of the NIB contains this code:
import UIKit
class CustomCollectionViewCell: UICollectionViewCell {
@IBOutlet weak var imageView: UIImageView!
@IBOutlet weak var statusTextView: UITextView!
@IBOutlet weak var activityIndicatorView: UIActivityIndicatorView!
@IBOutlet weak var titleTextView: UITextView!
@IBOutlet weak var infoTextView: UITextView!
override func awakeFromNib() {
super.awakeFromNib()
}
}
All of the IBOutlets are connected to the corresponding view in the NIB. I have also registered my NIB using this in the view controller's viewWillAppear method:
collectionView.register(UINib(nibName: "CustomCollectionViewCell", bundle: .main), forCellWithReuseIdentifier: "image")
and I also set the reuse identifier to "image" in StoryBoard and set the class of the cell to my CustomCollectionViewCell. Yet, I am getting this crash error:
Thread 1: "[<NSObject 0x6000012f0b50> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key activityIndicatorView."
I appreciate your help.