Setting a UICollectionViewLayout subclass in a storyboard

Viewed 2824

I'm using a storyboard for my project and I want to have a scene that's a UICollectionViewController sub class, who's UICollectionView uses a UICollectionViewLayout subclass.

I've set this up in a storyboard, and I'm trying to change the "Custom Class" of the collection view's layout instance.

Here's a screen grab of the layout object that I have selected in the storyboard:

Storyboard object tree with <code>UICollectionViewLayout</code> selected

Here's a screen grab of storyboard's "Identity" inspector pane showing the "Custom Class" field that I am changing (it's at the top):

Storyboard Identity inspector showing "Custom Class"

When I try to change the "Custom Class", I can change type stuff in, but after saving, the it reverts back to being the default UICollectionViewFlowLayout. If I run the project, the default UICollectionViewFlowLayout gets used even though it's not the custom class I have set.

How can I set a custom layout class, please?

1 Answers
Related