Skip to content

Instantly share code, notes, and snippets.

@eilonkr
Last active November 30, 2020 09:29
Show Gist options
  • Save eilonkr/ff3b189571c5f824c60fe7d67bda1e82 to your computer and use it in GitHub Desktop.
Save eilonkr/ff3b189571c5f824c60fe7d67bda1e82 to your computer and use it in GitHub Desktop.
LibraryViewModel.swift
class LibraryViewModel: CollectionViewModel<NoteCell> {
init(collectionView: UICollectionView) {
super.init(collectionView: collectionView, cellReuseIdentifier: "NoteCell")
}
}
// MARK: - UICollectionViewDelegate Implementation
extension LibraryViewModel: UICollectionViewDelegate {
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
remove([items.value[indexPath.item]])
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment