Nis*_*ngh 4 iphone objective-c uitouch uigesturerecognizer ios
我有一个UIView和一个可拖动 UIImageView.背景颜色UIView是绿色.
当我拖动图像时,UIImageView会触摸UIView.当我拖动图像UIView的颜色UIView应该变成红色.
如何检查UIImageView到达UIView?
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
if (CGRectIntersectsRect(imageview.frame, view.frame)) {
view.backgroundColor=[UIColor redcolor];
}
}
Run Code Online (Sandbox Code Playgroud)