如何在UIView中获取手指敲击的坐标?(我不喜欢使用一大堆按钮)
谢谢
发布于 2017-08-16 21:04:24
Swift 3答案
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(self.tapAction(_:)))
yourView.addGestureRecognizer(tapGesture)
func tapAction(_ sender: UITapGestureRecognizer) {
let point = sender.location(in: yourView)
}https://stackoverflow.com/questions/6113860
复制相似问题