Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tsraveling/ea1fd7624421bd4c8f4356ac1a6598d6 to your computer and use it in GitHub Desktop.
Save tsraveling/ea1fd7624421bd4c8f4356ac1a6598d6 to your computer and use it in GitHub Desktop.
UICollectionView delegate and datasource
// MARK: - UICollectionView Datasource and Delegate -
func numberOfSections(in collectionView: UICollectionView) -> Int {
return 1
}
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
// TODO: Implement count.
return 1
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath)
return cell
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment