Created
May 17, 2018 20:22
-
-
Save harrysummers/2102f6b2aa2db1855ae52aedeef94b4d to your computer and use it in GitHub Desktop.
CollectionView delegates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { | |
let gif = gifs[indexPath.row] | |
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: cellId, for: indexPath) as! GifCollectionViewCell | |
cell.gifView.loadGif(name: gif) | |
return cell | |
} | |
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { | |
return 3 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment