I am unable to make this work. When I checked the Chapter 24 sample code (download) this code is omitted
Code from PhotoCollectionViewCell
class PhotoCollectionViewCell: UICollectionViewCell {
var photoDescription:String?
override var accessibilityLabel: String? {
get {
return photoDescription
}
set {
// Ignore
}
}
Code from PhotoDataSource:
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let identifier = "PhotoCollectionViewCell"
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: identifier, for: indexPath)
let photo = photos[indexPath.row]
cell.photoDescription = photo.title // <<< Compiler Error Here !!!
return cell
}
Compiler Error: ââUICollectionViewCellâ has no member âphotoDescriptionââ
Any Ideas?