Instance Method


Changes the collection view’s layout and notifies you when the animations complete.


- (void)setCollectionViewLayout:(UICollectionViewLayout *)layout animated:(BOOL)animated completion:(void (^)(BOOL finished))completion;



The new layout object for the collection view.


Specify YES if you want to animate changes from the current layout to the new layout specified by the layout parameter. Specify NO to make the change without animations.


The block that is executed when the layout transition finishes or is aborted by the user. This block takes the following parameter:


A Boolean indicating whether the transition completed successfully. This parameter is YES if the transition finished and the new layout is installed. It is NO if the user aborted the transition and returned to the old layout.


This method initiates a layout change programmatically, notifying you when the transition is complete. If you choose to animate the layout change, the animation timing and parameters are controlled by the collection view.

See Also

Changing the Layout


The layout used to organize the collected view’s items.

- setCollectionViewLayout:animated:

Changes the collection view’s layout and optionally animates the change.

- startInteractiveTransitionToCollectionViewLayout:completion:

Changes the collection view’s current layout using an interactive transition effect.

- finishInteractiveTransition

Tells the collection view to finish an interactive transition by installing the intended target layout.

- cancelInteractiveTransition

Tells the collection view to abort an interactive transition and return to its original layout object.

Customizing Collection View Layouts

Customize a view layout by changing the size of cells in the flow or implementing a mosaic style.