The methods adopted by the object you use to manage data and provide cells for a collection view.
- iOS 6.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
A data source object manages the data in your collection view. It represents your app's data model and vends information to the collection view as needed. It also creates and configures the cells and supplementary views used by the collection view to display your data.
At a minimum, all data source objects must implement the
collection methods. These methods are responsible for returning the number of items in the collection view along with the items themselves. The remaining methods of the protocol are optional and only needed if your collection view organizes items into multiple sections or provides headers and footers for a given section.
When configuring the collection view object, assign your data source to its
data property. For more information about how a collection view works with its data source to present content, see