0

Although i know that the region monitoring supports iPhone4 and iPad2 only i want to implement this with the startMonitoringSignificantLocationChanges method.

I have a method that get my saved region (place with latitude, longitude and radius) and my current location and i want to return true in case they are near each other. My question is how do I calculate based on my information (both place and current location latitude,longitude and radius) if those places are near each other or not? Thank you.

Elad
  • 479
  • 3
  • 11
  • 21

2 Answers2

0

It can be done, but you have to manually code things out for the region. I found this article that may help you out.

Getting GPS location, region in background...

Bill Burgess
  • 14,054
  • 6
  • 49
  • 86
0

Use distanceFromLocation:

CLLocation *current = [[CLLocation alloc] initWithLatitude:lat longitude:long];
CLLocation *target = ...
CLLocationDistance meters = [current distanceFromLocation:target];
if (meters<radius) { /* you are closer than radius meters */ }
Jano
  • 62,815
  • 21
  • 164
  • 192