Skip to content

Instantly share code, notes, and snippets.

@aminbenarieb
Created March 27, 2016 00:11
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 aminbenarieb/f821d58a2731af71eba6 to your computer and use it in GitHub Desktop.
Save aminbenarieb/f821d58a2731af71eba6 to your computer and use it in GitHub Desktop.
func handleTap(sender: UITapGestureRecognizer? = nil) {
var indexPath: NSIndexPath!
if let label = sender?.view as? UILabel
{
if let superview = label.superview {
if let cell = superview.superview as? UICollectionViewCell {
indexPath = wordBuilder.indexPathForCell(cell)
}
}
let cell = wordBuilder.dequeueReusableCellWithReuseIdentifier(reuseIdentifier, forIndexPath: indexPath)
// working with cell
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment