Reputation: 3996
As the question itself is self explanatory, How do i check if a given point is inside a given frame of view.
Upvotes: 3
Views: 6145
Reputation: 21808
CGRectContainsPoint(view.frame, point);
Reference: CGRectContainsPoint
Upvotes: 8
Reputation: 31311
You can achieve it through many ways
UIView
pointInside
method. It returns a Boolean value indicating whether the receiver contains the specified point.
-(BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event
CGGeometry
CGRectContainsPoint
method. It returns whether a rectangle contains a specified point.
bool CGRectContainsPoint (CGRect rect, CGPoint point);
CGGeometry
CGPointEqualToPoint
method.It returns whether two points are equal.
bool CGPointEqualToPoint (CGPoint point1, CGPoint point2);
Upvotes: 14