ios - Long Press Gesture Recognizer Interfering With Scroll in UITableView -


i'm having trouble adding long press gesture uitableview. well, technically, have long press gesture recognizer, set minimum taps duration 0.08. did because want have same general action tapping , holding down cell, action changes based on how long cell held. anyway, here code add gesture recognizer (in viewdidload) :

    var longpress:uilongpressgesturerecognizer = uilongpressgesturerecognizer(target: self, action: "handlelongpress:")     longpress.minimumpressduration = 0.08     longpress.delegate = self     longpress.cancelstouchesinview  = false     self.tableview.addgesturerecognizer(longpress)     self.tableview.pangesturerecognizer.requiregesturerecognizertofail(longpress) 

in handlelongpress() function, cgpoint there long press , tableview cell that.

so basically, if scroll quickly, (like if flick screen), table view scrolls fine. if try scroll slowly, long press event fires , can't scroll.

all want able scroll slowly, want tableviews default scroll gesture override long press.

thanks!

scrollviews have pangesturerecognizer property, can call requiregesturerecognizertofail on long press recognizer scrollview's pangesturerecognizer argument , fire if pan gesture in scroll view fails.


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -