Skip to content

Instantly share code, notes, and snippets.

@LeoAOliveira
Last active June 19, 2019 02:05
Show Gist options
  • Save LeoAOliveira/adb59d8a4aed865d17a95f40eebd3628 to your computer and use it in GitHub Desktop.
Save LeoAOliveira/adb59d8a4aed865d17a95f40eebd3628 to your computer and use it in GitHub Desktop.
// MARK: - Table View
// Provém um objeto de célula para cada linha.
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
// Parte 1: Buscar uma célula do tipo apropriado.
let cell = tableView.dequeueReusableCell(withIdentifier: "tableCell", for: indexPath) as! TableViewCell
// Parte 2: Configurar o conteúdo da célula.
cell.titleLabel!.text = "Título"
cell.layer.backgroundColor = UIColor.white as! CGColor
cell.collectionView.delegate = self
cell.collectionView.dataSource = self
return cell
}
// MARK: - Collection View
// Retorna o número de itens para a collection.
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
// code
}
// Provém um objeto de célula para cada item.
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
// code
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment