scheduledTimer(timeInterval:invocation:repeats:)
Creates a new timer and schedules it on the current run loop in the default mode.
Declaration
class func scheduledTimer(timeInterval ti: TimeInterval, invocation: NSInvocation, repeats yesOrNo: Bool) -> TimerParameters
- ti:
The number of seconds between firings of the timer. If
tiis less than or equal to0.0, this method chooses the nonnegative value of0.0001seconds instead. - invocation:
The invocation to use when the timer fires. The invocation object maintains a strong reference to its arguments until the timer is invalidated.
- yesOrNo:
If True, the timer will repeatedly reschedule itself until invalidated. If False, the timer will be invalidated after it fires.
Return Value
A new NSTimer object, configured according to the specified parameters.
Discussion
After ti seconds have elapsed, the timer fires, invoking invocation.
See Also
Related Documentation
- Threading Programming Guide
- Timer Programming Topics
Creating a Timer
scheduledTimer(withTimeInterval:repeats:block:)scheduledTimer(timeInterval:target:selector:userInfo:repeats:)init(timeInterval:repeats:block:)init(timeInterval:target:selector:userInfo:repeats:)init(timeInterval:invocation:repeats:)init(fire:interval:repeats:block:)init(fireAt:interval:target:selector:userInfo:repeats:)