| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 608e3c6 commit 51dbb75
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,6 +30,7 @@ extension Timer { | |||
| 30 | 30 | ||
| 31 | 31 | /// Create and schedule a timer that will call `block` once after the specified time. | |
| 32 | 32 | ||
| 33 | + @discardableResult | ||
| 33 | 34 | public class func after(_ interval: TimeInterval, _ block: () -> Void) -> Timer { | |
| 34 | 35 | let timer = Timer.new(after: interval, block) | |
| 35 | 36 | timer.start() | |
@@ -38,6 +39,7 @@ extension Timer { | |||
| 38 | 39 | ||
| 39 | 40 | /// Create and schedule a timer that will call `block` repeatedly in specified time intervals. | |
| 40 | 41 | ||
| 42 | + @discardableResult | ||
| 41 | 43 | public class func every(_ interval: TimeInterval, _ block: () -> Void) -> Timer { | |
| 42 | 44 | let timer = Timer.new(every: interval, block) | |
| 43 | 45 | timer.start() | |
@@ -47,7 +49,8 @@ extension Timer { | |||
| 47 | 49 | /// Create and schedule a timer that will call `block` repeatedly in specified time intervals. | |
| 48 | 50 | /// (This variant also passes the timer instance to the block) | |
| 49 | 51 | ||
| 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 { | ||
| 51 | 54 | let timer = Timer.new(every: interval, block) | |
| 52 | 55 | timer.start() | |
| 53 | 56 | return timer | |
| Back | FazBrowse Home | New Git URL |
0 commit comments