Skip to content

Instantly share code, notes, and snippets.

@wanggang316
Last active January 3, 2018 07:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wanggang316/5fc0faeac0344e0695c923c7314df527 to your computer and use it in GitHub Desktop.
Save wanggang316/5fc0faeac0344e0695c923c7314df527 to your computer and use it in GitHub Desktop.
/// https://stackoverflow.com/questions/40365971/how-to-add-tap-gesture-to-uicollectionview-while-maintaining-cell-selection
let tapGesture = UITapGestureRecognizer.init(target: self, action: #selector(tapAction))
tapGesture.cancelsTouchesInView = false
self.messagesCollectionView.isUserInteractionEnabled = true
self.messagesCollectionView.addGestureRecognizer(tapGesture)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment