ios - Long Press Gesture Recognizer Only Fired When Finger is Lifted -
i'm having interesting problem long press gesture recognizer. placed 1 of these on uitableview, , works when lift finger after long press. basically, place finger on cell, , when lift finger, triggers long press. figured out putting printn
s when long press began , ended , both fire after lift finger. think tableviews default pangesturerecognizer
might interfering longpressgesturerecognizer
. here code in viewdidload
:
var longpress:uilongpressgesturerecognizer = uilongpressgesturerecognizer(target: self, action: "handlelongpress:") longpress.minimumpressduration = 0.06 longpress.delegate = self self.tableview.addgesturerecognizer(longpress) longpress.requiregesturerecognizertofail(self.tableview.pangesturerecognizer)
touching down in cell not cause table view's pangesturerecognizer fail, delete requiregesturerecognizertofail method, , should .began state while finger still down.
Comments
Post a Comment