To add, but change, what katleta3000 answered, you can restrict the protocol to only applicable to the class
CollectionViewProtocol: class
so you don't need 'useProtocolForCollectionView:' be mutating
What then makes it so that you do not need it is var reference = self , and you can simply say self.userProtocolForCollectionView(collectionView)
Especially if you plan to implement this protocol only with NSObject or class types (UIViewController, UICollectionView, etc.)
source share