Asks your data source object for the cell that corresponds to the specified item in the collection view.
- iOS 6.0+
- tvOS 9.0+
The collection view requesting this information.
The index path that specifies the location of the item.
A configured cell object. You must not return
nil from this method.
Your implementation of this method is responsible for creating, configuring, and returning the appropriate cell for the given item. You do this by calling the
dequeue method of the collection view and passing the reuse identifier that corresponds to the cell type you want. That method always returns a valid cell object. Upon receiving the cell, you should set any properties that correspond to the data of the corresponding item, perform any additional needed configuration, and return the cell.
You do not need to set the location of the cell inside the collection view’s bounds. The collection view sets the location of each cell automatically using the layout attributes provided by its layout object.
is on the collection view is set to
true then this method is called in advance of the cell appearing. Use the
collection delegate method to make any changes to the appearance of the cell to reflect its visual state such as selection.
This method must always return a valid view object.