Apparently, The cell didn't appear on view... any reason why this could have happened...
I could see the red background from view did load. Here is my code. Couldn't figure out why?
class PhotoSelectorController: UICollectionViewController{
let cellID = "cellID"
override func viewDidLoad() {
super.viewDidLoad()
collectionView?.backgroundColor = .red
collectionView?.register(UICollectionViewCell.self, forCellWithReuseIdentifier: "cellID")
}
override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return 5
}
override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cellID", for: indexPath)
cell.backgroundColor = .blue
return cell
}
}