The library allows you to create a timer that works either with RunLoop or with GCD.
timer = TITimer(type: .runloopTimer(runloop: .current, mode: .default), mode: .activeAndBackground)
timer.eventHandler = {
// handle elapsed time
}
timer.start()
timer.invalidate()
timer = TITimer(type: .dispatchSourceTimer(queue: .main), mode: .activeAndBackground)
timer.eventHandler = {
// handle elapsed time
}
timer.start()
timer.invalidate()
link |
Stars: 0 |
Last commit: 2 years ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics