Skip to content

Instantly share code, notes, and snippets.

@LeoAOliveira
Last active June 19, 2019 01:50
Show Gist options
  • Save LeoAOliveira/9d995655580e2e54159694e6391f8bb8 to your computer and use it in GitHub Desktop.
Save LeoAOliveira/9d995655580e2e54159694e6391f8bb8 to your computer and use it in GitHub Desktop.
// Retorna o número de itens para a collection.
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return 3
}
// Provém um objeto de célula para cada item.
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
// Parte 1: Buscar uma célula do tipo apropriado.
let cellCollection = collectionView.dequeueReusableCell(withReuseIdentifier: "collectionCell", for: indexPath) as! CollectionViewCell
// Parte 2: Configurar o conteúdo da célula.
cellCollection.collectionViewTextLabel!.text = "Texto"
return cellCollection
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment