Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting UICollectionViewLayout class in Storyboard

I want to use this excellent UICollectionView layout: https://github.com/bryceredd/RFQuiltLayout

As expected, it wants me to set my Collection View's layout class to it. This can't be done, because Xcode does not accept RFQuiltLayout in the class field (beeps, and clears the field if I select anything else).

I tried this with a new, empty project too.

What did I wrong?

(Tried in both Xcode 4.2.1/iOS 6 and Xcode 5/iOS 7, OS X Mavericks.)

like image 204
gklka Avatar asked Dec 10 '13 16:12

gklka


People also ask

How do I make UICollectionView programmatically?

To create a UICollectionView programmatically, I will create a new instance of UICollectionView by giving it a UICollectionViewFlowLayout as a parameter. The above collection view will not display any items however.

What is the difference between UITableView and UICollectionView?

For the listing details of each item, people use UITableView because it shows more info on each item. The UICollectionView class manages an ordered collection of data items and presents them using customizable layouts.

What is Collectionviewlayout?

An abstract base class for generating layout information for a collection view.


1 Answers

You are probably trying to set it in the Class field of the Identity Inspector, which is for the UICollectionView's class or subclass.

Instead, open the CollectionView's Attributes Inspector, select Layout > Custom and below Class > RFQuiltLayout:

enter image description here

like image 63
Guto Araujo Avatar answered Oct 01 '22 22:10

Guto Araujo