如何检查UIView和UIImageView是否在iphone sdk中被触及?

Nis*_*ngh 4 iphone objective-c uitouch uigesturerecognizer ios

我有一个UIView和一个可拖动 UIImageView.背景颜色UIView绿色.

当我拖动图像时,UIImageView会触摸UIView.当我拖动图像UIView的颜色UIView应该变成红色.

如何检查UIImageView到达UIView

Ash*_*ini 8

-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{   
    if (CGRectIntersectsRect(imageview.frame, view.frame)) {
        view.backgroundColor=[UIColor redcolor];
    }
}
Run Code Online (Sandbox Code Playgroud)