Ios 在另一个UIImageView下获取UIImageView

Ios 在另一个UIImageView下获取UIImageView,ios,objective-c,uiimageview,tags,Ios,Objective C,Uiimageview,Tags,我有一些问题 我在self.view上添加了UIImageView。而不是添加了另一个UIImageView。第二个UIImageView可以在self.view上移动 当第二个UIImageView超过第一个UIImageView时,我可以获得第一个UIImageView的标记吗 谢谢不清楚,但请先尝试将标记设置为uiimageview,然后尝试获取标记。设置标记:-firstimageview.tag=1;get tag:-int tag=firstimageviiew.tag;是的,我设置

我有一些问题

我在self.view上添加了UIImageView。而不是添加了另一个UIImageView。第二个UIImageView可以在self.view上移动

当第二个UIImageView超过第一个UIImageView时,我可以获得第一个UIImageView的标记吗


谢谢

不清楚,但请先尝试将标记设置为uiimageview,然后尝试获取标记。设置标记:-firstimageview.tag=1;get tag:-int tag=firstimageviiew.tag;是的,我设置了标签。只需要知道如何确定另一个UIImageView下的UIImageView。是的,但我必须比较FirtimgView和secondimgeview的坐标?如果它们相等,比第二个视图下的第一个视图相等,是吗?是的,你是对的,你也可以通过比较两个图像视图的中心得到,如果两个图像视图的中心相等,那么两者都是重叠的
First give tag to firstimageview and secondimageview then using that tag you can identify any image view using below code
 UIImageView *firstimgeview = (UIImageView*)[self.view viewWithTag:firstimageviewtag];
 UIImageView *secondimgeview = (UIImageView*)[self.view viewWithTag:secondimageviewtag];