Skip to content

Instantly share code, notes, and snippets.

@thiagobutignon
Last active September 12, 2019 19:19
Show Gist options
  • Save thiagobutignon/3691ee161bdf1ebd90ac27b761f5336f to your computer and use it in GitHub Desktop.
Save thiagobutignon/3691ee161bdf1ebd90ac27b761f5336f to your computer and use it in GitHub Desktop.
// Entra quando a célula é clicada
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
if let cell = collectionView.cellForItem(at: indexPath) as? CB3DSelectCell {
cell.select(animated: true)
// if cell.isSelected {
// cell.select(animated: false)
// if indexPath.row == 0 {
// self.dataprovider?.routeToSignUPMerchantPerson()
// } else {
// self.dataprovider?.routeToSignUPMerchant()
// }
// } else {
// cell.deselect(animated: false)
//
// }
}
}
// Não entra quando a célula selecionada é clicada. Entra apenas quando outra célula é selecionada.
func collectionView(_ collectionView: UICollectionView, didDeselectItemAt indexPath: IndexPath) {
if let cell = collectionView.cellForItem(at: indexPath) as? CB3DSelectCell {
cell.deselect(animated: true)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment