File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff 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
3334public class func after( _ interval: TimeInterval , _ block: ( ) -> Void ) -> Timer {
3435let 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
4143public class func every( _ interval: TimeInterval , _ block: ( ) -> Void ) -> Timer {
4244let 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 {
5154let timer = Timer . new ( every: interval, block)
5255 timer. start ( )
5356return timer
You can’t perform that action at this time.
0 commit comments