Skip to content

UICollectionViewLayout ​

UICollectionViewLayout represents the object that decides how cells are arranged in a UICollectionView. It is the base class of layout objects: the argument UICollectionView() takes and the value collectionViewLayout returns are both of this type.

It has no members of its own. The only layout currently available is the list layout created by UICollectionViewCompositionalLayout.

Inheritance: EventTarget → NSObject → UICollectionViewLayout

Constructor ​

Cannot be created with new; new UICollectionViewLayout() throws TypeError. Create a layout with UICollectionViewCompositionalLayout.layoutWithListConfiguration().

Corresponding iOS API ​

UICollectionViewLayout. In ObjC you customize layout by subclassing it; in JS native classes cannot be subclassed, see Native classes.

See also ​