Registers a class for use in creating decoration views for a collection view.
- iOS 6.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
The class to use for the supplementary view.
The element kind of the decoration view. You can use this string to distinguish between decoration views with different purposes in the layout. This parameter must not be
niland must not be an empty string.
This method gives the layout object a chance to register a decoration view for use in the collection view. Decoration views provide visual adornments to a section or to the entire collection view but are not otherwise tied to the data provided by the collection view’s data source.
You do not need to create decoration views explicitly. After registering one, it is up to the layout object to decide when a decoration view is needed and return the corresponding layout attributes from its
layout method. For layout attributes that specify a decoration view, the collection view creates (or reuses) a view and displays it automatically based on the registered information.
If you previously registered a class or nib file with the same kind string, the class you specify in the
view parameter replaces the old entry. You may specify
view if you want to unregister the decoration view.