2015-07-02 2 views
1

Есть ли способ инициализировать NSTimer в swift в AppDelegate. Я пытаюсь запустить таймер, как только пользовательский выход будет областью мониторинга маяков.Как инициализировать NSTimer в 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
var timer = NSTimer.scheduledTimerWithTimeInterval(0.4, target: self, selector: Selector("yourFunction"), userInfo: nil, repeats: true) 
Смежные вопросы