I want to test if a CLLocationCoordinate2D is inside a Square created from other four CLLocationCoordinate2D
I have a struct like this:
typedef struct {
CLLocationCoordinate2D southWest;
CLLocationCoordinate2D southEast;
CLLocationCoordinate2D northEast;
CLLocationCoordinate2D northWest;
} Bounds;
And a CLLocationCoordinate2D coordinate passed as param. And I want to test if coordinate is inside the Bounds. How can I test that?
- (BOOL) isCoordinate:(CLLocationCoordinate2D)coordinate insideBounds:(Bounds)bounds { ... }
If you have four points you can make a CGRect and use CGRectContainsPoint()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With