Skip to content

Commit 51dbb75

Browse files
committed
Mark Timer.after, Timer.every as @discardableResult
1 parent 608e3c6 commit 51dbb75

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Sources/SwiftyTimer.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ extension Timer {
3030

3131
/// Create and schedule a timer that will call `block` once after the specified time.
3232

33+
@discardableResult
3334
public class func after(_ interval: TimeInterval, _ block: () -> Void) -> Timer {
3435
let timer = Timer.new(after: interval, block)
3536
timer.start()
@@ -38,6 +39,7 @@ extension Timer {
3839

3940
/// Create and schedule a timer that will call `block` repeatedly in specified time intervals.
4041

42+
@discardableResult
4143
public class func every(_ interval: TimeInterval, _ block: () -> Void) -> Timer {
4244
let timer = Timer.new(every: interval, block)
4345
timer.start()
@@ -47,7 +49,8 @@ extension Timer {
4749
/// Create and schedule a timer that will call `block` repeatedly in specified time intervals.
4850
/// (This variant also passes the timer instance to the block)
4951

50-
@nonobjc public class func every(_ interval: TimeInterval, _ block: (Timer) -> Void) -> Timer {
52+
@nonobjc @discardableResult
53+
public class func every(_ interval: TimeInterval, _ block: (Timer) -> Void) -> Timer {
5154
let timer = Timer.new(every: interval, block)
5255
timer.start()
5356
return timer

0 commit comments

Comments
 (0)