ios swift 任意view 添加tap点击事件

let tap = UITapGestureRecognizer(target: self, action: #selector(tap(r:)))
       clickView.addGestureRecognizer(tap)

 @objc func tap(r: UITapGestureRecognizer) {
            stickers.forEach { s in
               //点击事件
            }
        }

你可能感兴趣的:(ios swift 任意view 添加tap点击事件)