We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
stop
invalidate
1 parent 2927287 commit 2ba7889Copy full SHA for 2ba7889
1 file changed
Src/SwiftyTimer.swift
@@ -78,16 +78,12 @@ extension NSTimer {
78
/// Schedule this timer on the run loop
79
///
80
/// By default, the timer is scheduled on the current run loop for the default mode.
81
- /// Specify `runLoop` or `mode` to override these defaults.
+ /// Specify `runLoop` or `modes` to override these defaults.
82
83
- public func start(runLoop: NSRunLoop = NSRunLoop.currentRunLoop(), mode: String = NSDefaultRunLoopMode) {
84
- runLoop.addTimer(self, forMode: mode)
85
- }
86
-
87
- /// Invalidate this timer (alias to `invalidate`)
88
89
- public func stop() {
90
- invalidate()
+ public func start(runLoop: NSRunLoop = NSRunLoop.currentRunLoop(), modes: [String] = [NSDefaultRunLoopMode]) {
+ for mode in modes {
+ runLoop.addTimer(self, forMode: mode)
+ }
91
}
92
93
0 commit comments