ios - Display button on UICollectionViewCell after UILongPressGestureRecognizer -


i have uilongpressgesturerecognizer on cell collectionview , want display button (and others) cells after long touch happens. here's code:

func collectionview(collectionview: uicollectionview, cellforitematindexpath indexpath: nsindexpath) -> uicollectionviewcell {          let cell: cellcontroller = collection.dequeuereusablecellwithreuseidentifier("cell", forindexpath: indexpath) as! cellcontroller          cell.exitbutton.hidden = true          return cell     } 

i want set false cell.exitbutton.hidden after touch happen.

thanks in advance

have bool variable in collectionview's class scope. when detect long press, modify bool variable. in example, i'll declare var exitbuttonhidden = true.

change implementation of cellforitematindexpath, such modifies cell.exitbutton.hidden = true cell.exitbutton.hidden = exitbuttonhidden.

now, need call reloaddata on collectionview whenever detect long press collectionview gets chance refresh cells again.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -