TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Jan 2015 |
SPMSupports SPM | ✗ |
Maintained by Ash Furrow.
Everyone has made block NSTimer categories for NSTimer
in Objective-C. But who has done it in Swift? Well, probably lots of people, but the point is that it is not as straightforward as you might think.
pod 'Haste'
to your Podfile.import Haste
whevever you want to time things with closures.Call the following function.
NSTimer.scheduledTimerWithTimeInterval(1, block: { () -> () in
println("Why does anyone do the things they do?")
}, repeats: true)
That function returns the NSTimer
instance, so you can call invalidate()
on it when you want things to stop.