I have a timer in my application that triggers a certain event:
myTimer = NSTimer.scheduledTimerWithTimeInterval(10, target: self,
selector: \"searchFor
First schedule the timer as you've done.
timer = NSTimer.scheduledTimerWithTimeInterval(
10.0, target: self,
selector: "searchForDrivers:",
userInfo: nil,
repeats: true
)
Then, immediately afterwards, fire timer
.
timer.fire()
According to the documentation,
You can use this method to fire a repeating timer without interrupting its regular firing schedule. If the timer is non-repeating, it is automatically invalidated after firing, even if its scheduled fire date has not arrived.
See the NSTimer Class Reference for more information.