What are your thoughts about including the timer object in the block?
public class func every(interval: NSTimeInterval, _ block: NSTimer -> Void) -> NSTimer {}
Otherwise I need to declare the variable separately like this:
var timer: NSTimer?
timer = NSTimer.every(5.seconds) {
timer?.invalidate()
}
What are your thoughts about including the timer object in the block?
Otherwise I need to declare the variable separately like this: