有没有办法在AppDelegate
中初始化swift中的func locationManager(manager: CLLocationManager!,
didExitRegion region: CLRegion!) {
manager.stopRangingBeaconsInRegion(region as! CLBeaconRegion)
manager.stopUpdatingLocation()
NSLog("You exited the region")
sendLocalNotificationWithMessage("You exited the region", playSound: true)
}
。一旦用户退出像这样的信标监控区域,我就试图启动计时器。
{{1}}
答案 0 :(得分:1)
var timer = NSTimer.scheduledTimerWithTimeInterval(0.4, target: self, selector: Selector("yourFunction"), userInfo: nil, repeats: true)