Asks the layout object if changes to a self-sizing cell require a layout update.
- iOS 8.0+
- tvOS 9.0+
The layout attributes returned by the cell’s
Layout Attributes Fitting(_:)
The attributes that the layout object originally suggested for the cell.
true if the layout should be invalidated or
false if it should not.
When a collection view includes self-sizing cells, the cells are given the opportunity to modify their own layout attributes before those attributes are applied. A self-sizing cell might do this to specify a different cell size than the one the layout object provides. When the cell provides a different set of attributes, the collection view calls this method to determine if the cell’s change requires a larger layout refresh.
If you are implementing a custom layout, you can override this method and use it to determine if your layout should be invalidated based on the specified attributes. The default implementation of this method returns