Skip to content

Instantly share code, notes, and snippets.

@ayoub-9
Created March 21, 2019 15:51
Show Gist options
  • Save ayoub-9/fa9da3adb9ceeb63dab72569b4db250e to your computer and use it in GitHub Desktop.
Save ayoub-9/fa9da3adb9ceeb63dab72569b4db250e to your computer and use it in GitHub Desktop.
func collectionView(_ collectionView: UICollectionView, didHighlightItemAt indexPath: IndexPath) {
UIView.animate(withDuration: 0.5) {
if let cell = collectionView.cellForItem(at: indexPath) as? ExploreWorldCell {
cell.postImage.isHidden = true
}
}
}
func collectionView(_ collectionView: UICollectionView, didUnhighlightItemAt indexPath: IndexPath) {
UIView.animate(withDuration: 0.5) {
if let cell = collectionView.cellForItem(at: indexPath) as? ExploreWorldCell {
cell.postImage.isHidden = false
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment