Skip to content

Commit 2927287

Browse files
committed
Tweak start() and stop()
1 parent aa278ab commit 2927287

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Src/SwiftyTimer.swift

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,19 @@ extension NSTimer {
7575
return timer
7676
}
7777

78-
/// Schedule this timer on the specified run loop (defaults to the current run loop)
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.
7982

80-
public func start(onRunLoop runLoop: NSRunLoop = NSRunLoop.currentRunLoop(), forMode mode: String = NSDefaultRunLoopMode) {
83+
public func start(runLoop: NSRunLoop = NSRunLoop.currentRunLoop(), mode: String = NSDefaultRunLoopMode) {
8184
runLoop.addTimer(self, forMode: mode)
8285
}
8386

84-
/// Invalidate this timer (provided to match `start`)
87+
/// Invalidate this timer (alias to `invalidate`)
8588

8689
public func stop() {
87-
self.invalidate()
90+
invalidate()
8891
}
8992
}
9093

0 commit comments

Comments
 (0)