我想为两个Image视图实现两个UITapGestureRecognizer 一个imageView是父视图,另一个是作为这些父视图的子视图添加的 如果我向其中两个添加UITapGestureRecognizer,应用程序不会触发子视图UITapGestureRecognizer。 每个点添加了UITapGestureRecognizer,但在我的应用程序中只触发最后一个点(point16)
@IBAction func clearSubViewsFromImageMapView(_ sender: Any) {
mapImageView.removeGestureRecognizer(tapImageGestureRecognizer)
drawPath()
mapImageView.subviews.forEach {
if case _ as UIImageView = $0 {
$0.removeFromSuperview();
mapImageView.addSubview($0)
$0.addGestureRecognizer(tapGestureRecognizer)
//$0.addGestureRecognizer(tapGestureRecognizer)
}
}
}
提前致谢。