Im currently working with "Regions" Sample code: https://developer.apple.com/library/ios/#samplecode/Regions/Introduction/Intro.h tml # // apple_ref / doc / uid / DTS40010726-Intro- DontLinkElementID_2
I would like to take one more step and generate or ignite when the user leaves the region (maybe for both entering and exiting, I do not mind, which is easier for the initial implementation).
I looked at a link to the CLLocation class, location programming guide, local and push notification programming guide. And he suffers from information overload.
Many thanks:)
EDIT: I think I might come up with an idea that solves the problem: in the RegionsViewController implementation file there is the following:
- (void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion *)region { NSString *event = [NSString stringWithFormat:@"didExitRegion %@ at %@", region.identifier, [NSDate date]]; [self updateWithEvent:event]; }
Since I want to implement local notification when the user leaves the specified border of the area, I entered this:
- (void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion *)region { NSString *event = [NSString stringWithFormat:@"didExitRegion %@ at %@", region.identifier, [NSDate date]]; [self updateWithEvent:event];
Can someone advise me if this is correct or any recommendations? (apologies for poor formatting)
Dan_R source share