2525import Foundation
2626
2727private class NSTimerActor {
28- var block : ( ) -> ( )
28+ var block : ( ) -> Void
2929
30- init ( _ block: ( ) -> ( ) ) {
30+ init ( _ block: ( ) -> Void ) {
3131 self . block = block
3232 }
3333
@@ -44,7 +44,7 @@ extension NSTimer {
4444 /// **Note:** the timer won't fire until it's scheduled on the run loop.
4545 /// Use `NSTimer.after` to create and schedule a timer in one step.
4646
47- public class func new( after interval: NSTimeInterval , _ block: ( ) -> ( ) ) -> NSTimer {
47+ public class func new( after interval: NSTimeInterval , _ block: ( ) -> Void ) -> NSTimer {
4848 let actor = NSTimerActor ( block)
4949 return self . init ( timeInterval: interval, target: actor , selector: " fire " , userInfo: nil , repeats: false )
5050 }
@@ -54,22 +54,22 @@ extension NSTimer {
5454 /// **Note:** the timer won't fire until it's scheduled on the run loop.
5555 /// Use `NSTimer.every` to create and schedule a timer in one step.
5656
57- public class func new( every interval: NSTimeInterval , _ block: ( ) -> ( ) ) -> NSTimer {
57+ public class func new( every interval: NSTimeInterval , _ block: ( ) -> Void ) -> NSTimer {
5858 let actor = NSTimerActor ( block)
5959 return self . init ( timeInterval: interval, target: actor , selector: " fire " , userInfo: nil , repeats: true )
6060 }
6161
6262 /// Create and schedule a timer that will call `block` once after the specified time.
6363
64- public class func after( interval: NSTimeInterval , _ block: ( ) -> ( ) ) -> NSTimer {
64+ public class func after( interval: NSTimeInterval , _ block: ( ) -> Void ) -> NSTimer {
6565 let timer = NSTimer . new ( after: interval, block)
6666 timer. start ( )
6767 return timer
6868 }
6969
7070 /// Create and schedule a timer that will call `block` repeatedly in specified time intervals.
7171
72- public class func every( interval: NSTimeInterval , _ block: ( ) -> ( ) ) -> NSTimer {
72+ public class func every( interval: NSTimeInterval , _ block: ( ) -> Void ) -> NSTimer {
7373 let timer = NSTimer . new ( every: interval, block)
7474 timer. start ( )
7575 return timer
0 commit comments