Is there a way to verify if a CGPoint
is inside a specific CGRect
.
An example would be:
I\'m dragging a UIImageView
and I want t
It is so simple,you can use following method to do this kind of work:-
-(BOOL)isPoint:(CGPoint)point insideOfRect:(CGRect)rect
{
if ( CGRectContainsPoint(rect,point))
return YES;// inside
else
return NO;// outside
}
In your case,you can pass imagView.center as point and another imagView.frame as rect in about method.
You can also use this method in bellow UITouch Method :
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
}