Instance Property

collectionViewContentSize

The width and height of the collection view’s contents.

Declaration

@property(readonly) NSSize collectionViewContentSize;

Discussion

This property contains the width and height of all of the collection view’s contents, not just the content that is currently visible. The collection view uses this information to configure its scroll view.

When creating custom layouts, you must reimplement this property and provide the size of the collection view’s contents. It is recommended that you cache the content size and adjust the value when the layout changes or when items are added and removed.

The default value in this property is NSZeroSize.

See Also

Providing Layout Information

layoutAttributesClass

Returns the class to use for layout attribute objects

- prepareLayout

Prepares the layout object to begin laying out content.

- layoutAttributesForElementsInRect:

Returns the layout attribute objects for all items and views in the specified rectangle.

- layoutAttributesForItemAtIndexPath:

Returns the layout attributes for the item at the specified index path.

- layoutAttributesForSupplementaryViewOfKind:atIndexPath:

Returns the layout attributes of the supplementary view at the specified location in your layout.

- layoutAttributesForDecorationViewOfKind:atIndexPath:

Returns the layout attributes of the decoration view at the specified location in your layout.

- layoutAttributesForDropTargetAtPoint:

Returns layout attributes for the drop target at the specified point.

- layoutAttributesForInterItemGapBeforeIndexPath:

Returns layout attributes for the inter-item gap at the specified location in your layout.

- targetContentOffsetForProposedContentOffset:

Returns the offset value to use after an animated layout update or change.

- targetContentOffsetForProposedContentOffset:withScrollingVelocity:

Returns the offset value to use for the collection view’s content at the end of scrolling.