invalidationContext(forPreferredLayoutAttributes:withOriginalAttributes:)
Returns an invalidation context object that defines the portions of the layout that need to be updated.
Declaration
func invalidationContext(forPreferredLayoutAttributes preferredAttributes: NSCollectionViewLayoutAttributes, withOriginalAttributes originalAttributes: NSCollectionViewLayoutAttributes) -> NSCollectionViewLayoutInvalidationContextParameters
- preferredAttributes:
The preferred layout attributes of an element.
- originalAttributes:
The attributes that the layout object originally suggested for the item.
Return Value
An invalidation context that describes the changes to be made. This value is never nil.
Discussion
The default implementation of this method creates an instance of the class returned by the invalidationContextClass method and initializes it using its init() method. Subclasses can override this method and configure additional properties of the invalidation context. In your implementation, you must call super first to get the context object; you can then configure that object and return it.