ios - uigesturerecognizer double click on tableviewcell + segue swift -
override func prepareforsegue(segue: uistoryboardsegue, sender: anyobject?) {
if segue.identifier == "editinfo"{ let selecteditem: nsmanagedobject = items[self.tableview.indexpathforselectedrow!.row] as! nsmanagedobject let viewcon: addviewcontroller = segue.destinationviewcontroller as! addviewcontroller viewcon.usernameupdate = selecteditem.valueforkey("username") as! string viewcon.emailupdate = selecteditem.valueforkey("email") as! string viewcon.existeditem = selecteditem }
i tried following segue trigered on single tap
let doubletap = uitapgesturerecognizer(target: self, action: nil) doubletap.numberoftapsrequired = 2 doubletap.numberoftouchesrequired = 1 cell.addgesturerecognizer(doubletap)
check code double tap, simple.
you can put in sample project, debug, maybe else blocking code work properly.
override func viewdidload() { super.viewdidload() let doubletap = uitapgesturerecognizer(target: self, action: "doubletaphandler") doubletap.numberoftapsrequired = 2 view.addgesturerecognizer(doubletap) } func doubletaphandler() { print("double tap") }
Comments
Post a Comment