I am trying to make something works like UICollectionView, which let user implement UICollectionViewDelegate to handle actions. But since I am learning Swift, I would like to make it strong typed.
Here are my 2 attempts of designing the API. Both of them feels unnatural to use. It there a better way to do this?