Error in the UICollectionView template code

I have just been refreshing my memory on the use of the UICollectionView in iOS 9. This view is used to display a grid of items on the screen, such as you would see in the Photos app.

Dragging the UICollectionView onto the screen, I thought I would be a matter of minutes from getting a basic App working. Alas, no matter what I did, when I ran the app there would be no grid displayed.

After some digging around, thank you Alex Stone on Stack Overflow, it turns out that the troublesome line is an attempt to setup the UICollectionView.

self.collectionView!.registerClass(
   UICollectionViewCell.self, 
     forCellWithReuseIdentifier: reuseIdentifier)

Interestingly, I didn't type this line. It was added automatically by Apple's template code for a UICollectionViewController. Removing this line from the viewDidLoad() method causes the App to run as expected.

At least it was an easy fix. Now back to the simple App that I wanted to create as a demonstration for a programming class.