PhotoCollectionViewCell animation interferes with transition to PhotoInfoView

Hello together,

when I execute Photorama after building the transition to PhotoInfoView like on page 399 in the book.
Application builds, everything seems to work nicely.

But when clicking on one of the PhotoCollectionViewCells, instead of transitioning to the PhotoInfoView I get:

“Thread1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0”

in the else-block of update() method in PhotoCollectionViewCell-class:

import UIKit

class PhotoCollectionViewCell: UICollectionViewCell {
@IBOutlet var imageView: UIImageView!
@IBOutlet var spinner: UIActivityIndicatorView!

// Helper methode to show activity indicator
func update(with image: UIImage? ){
    if let imageToDisplay = image {
        spinner.stopAnimating()
        imageView.image = imageToDisplay
    }else{      +--------------------------(This is where the bug is shown)
        spinner.startAnimating()
        imageView.image = nil
    }
}

override func awakeFromNib() {
    super.awakeFromNib()
    
    update(with: nil)
}

override func prepareForReuse() {
    super.prepareForReuse()
    
    update(with: nil)
}

}

I know that it must be because imageView and spinner are nil, but why is that as soon the segue is triggered?
Because when I comment the else block in the update() method everything works fine.

I have the feeling I’m missing something really obvious or might have overseen or forgot something, because in the book is mentioned nothing about it, neither here in the forum.

I would really appreciate your help. Thanks in advance.

Are your PhotoCollectionView outlets set up as shown on p. 390 (figure 21.11)?

For whatever reason, I found that those connections had to be made in the storyboard itself rather than in the storyboard’s document outline.