Configuring data source methods for the collection view

The collection view needs to know how many cells to display and what to display in each cell. Normally, the view controller for the collection view is responsible for providing this information. Apple has already defined the collection view data source protocol for this purpose. All you need to do is connect the collection view's data source outlet to ExploreViewController and implement the required methods of the collection view data source protocol.

The collection view also needs to know what to do if the user taps on a collection view cell. Again, the view controller for the collection view is responsible, and Apple has defined the collection view delegate protocol for this purpose. ...

Get iOS 13 Programming for Beginners - Fourth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.