如何在Swift中的AppDelegate中初始化NSTimer

时间:2015-07-02 14:26:34

标签: ios swift

有没有办法在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}}

1 个答案:

答案 0 :(得分:1)

var timer = NSTimer.scheduledTimerWithTimeInterval(0.4, target: self, selector: Selector("yourFunction"), userInfo: nil, repeats: true)