iOS UIView touchesBegan 判断点击区域是否在某个view上

    override func touchesBegan(_ touches: Set, with event: UIEvent?) {
        guard let point = touches.first?.location(in: view) else { return }
        let p = someView.layer.convert(point, from: view.layer)
        if someView.layer.contains(p) {

        }
    }

你可能感兴趣的:(iOS UIView touchesBegan 判断点击区域是否在某个view上)