[Swift]addGestureRecognizer

addGestureRecognizer

let gest = UILongPressGestureRecognizer(target: self, action: #selector(self.onPushTargetView))
self.targetView.addGestureRecognizer(gest)