1

i have a button when i click button a view appear and i am performing some action to that specific view according to finger movement(pan gesture). if i add view on just click the button it works fine. if i add the view on long press. then then pan gesture not woking.

how can i add pan gesture on long press of button not on only press.

let pangesture = UIPanGestureRecognizer(target: self, action: #selector(pan_handler))
        btn.addGestureRecognizer(pangesture)

        let longpress = UILongPressGestureRecognizer(target: self, action: #selector(longpress_handler))
        btn.addGestureRecognizer(longpress)
Goal Tech
  • 167
  • 9

0 Answers0