-2

if I add tapgesture on background view then I have to long press for select cell and if I set numberoftaprequired is 2 the it will be work normally but I have to give one functionality on single tap

  • What exactly is your desired result? Do you want to single tap on a `UITableViewCell` and have it perform an action? And if so, what do you want the background tap (or double-tap, or long press) to act like? – ZbadhabitZ Sep 20 '18 at 01:50
  • Please add enough detail - code in particular - for someone to be able to duplicate your issue. It's **extremely** hard to understand what issue you are facing when your question is but a single sentence. –  Sep 20 '18 at 02:08
  • Just check this it may help you https://stackoverflow.com/a/37693082/6080920 – iOS Geek Sep 20 '18 at 04:25
  • Possible duplicate of [UITapGestureRecognizer breaks UITableView didSelectRowAtIndexPath](https://stackoverflow.com/questions/8192480/uitapgesturerecognizer-breaks-uitableview-didselectrowatindexpath) – Tamás Sengel Sep 20 '18 at 04:45

1 Answers1

1

add cancelsTouchesInView to your tap gesture

let tap = UITapGestureRecognizer(target: self, action: #selector(yourfunction))
tap.cancelsTouchesInView = false

try this

Midhun Narayan
  • 829
  • 2
  • 9
  • 26