File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed
Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -78,16 +78,12 @@ extension NSTimer {
7878 /// Schedule this timer on the run loop
7979 ///
8080 /// By default, the timer is scheduled on the current run loop for the default mode.
81- /// Specify `runLoop` or `mode ` to override these defaults.
81+ /// Specify `runLoop` or `modes ` to override these defaults.
8282
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 ( )
83+ public func start( runLoop: NSRunLoop = NSRunLoop . currentRunLoop ( ) , modes: [ String ] = [ NSDefaultRunLoopMode] ) {
84+ for mode in modes {
85+ runLoop. addTimer ( self , forMode: mode)
86+ }
9187 }
9288}
9389
You can’t perform that action at this time.
0 commit comments