HMLocationEvent

HMLocationEvent *locEvent = [[HMLocationEvent alloc] initWithRegion:region1];

region1.notifyOnEntry = YES;

region1.notifyOnExit = YES;

CLRegion *region1 =  [[CLCircularRegion alloc] initWithCenter:[selectedLoc coordinate] radius:5 identifier:@"Office"];

NSDateComponents *com = [[NSDateComponents alloc] init];
com.second = 1;

HMEventTrigger *tr = [[HMEventTrigger alloc] initWithName:eventName.text events:[NSArray arrayWithObject:locEvent] predicate:[HMEventTrigger predicateForEvaluatingTriggerOccurringOnDateWithComponents:com]];
[selectedHome addTrigger:tr completionHandler:^(NSError *err)
 {

 }];

posted on 2017-05-19 10:20  风乔  阅读(216)  评论(0编辑  收藏  举报

导航