Leveraging protocols to clean up your classes.
Here is what your average collection view class looks like
Now this is how your class should look like after this tutorial.
As you see we combined UICollectionViewDelegate, and UICollectionViewDataSource into one protocol making your class protocol list much shorter. Keep in mind there are some UIKit protocols that don’t let you do this such as UIViewController. Combining protocols is simple. Just create a protocol, and extend from the other protocols you want to use.
As you see with one line of code we can clean up those long lists of protocols into one simple protocol that has all of the protocols you need. You can also add your own required functions in these protocols if you wish.