let clickGesture = UITapGestureRecognizer(target: self, action: #selector(self.onUiViewClick)) uiView.addGestureRecognizer(clickGesture) @objc func onUiViewClick(sender : UITapGestureRecognizer) { }