Swiftpack.co - Loupehope/TITimer as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by Loupehope.
Loupehope/TITimer 1.0.0
Pretty timer ⏰
⭐️ 0
🕓 2 years ago
iOS
.package(url: "https://github.com/Loupehope/TITimer.git", from: "1.0.0")

TITimer

Pretty timer ⏰

The library allows you to create a timer that works either with RunLoop or with GCD.

Features

  • Track the time even while the application is in the background. For more, see - TimerRunMode
  • Create a timer on a personal queue or on a special Runloop mode. For more, see - TimerType
  • The code is covered by tests 🙂

Examples

RunLoop

timer = TITimer(type: .runloopTimer(runloop: .current, mode: .default), mode: .activeAndBackground)
        
timer.eventHandler = {
   // handle elapsed time
}
        
timer.start()
timer.invalidate()

GCD

timer = TITimer(type: .dispatchSourceTimer(queue: .main), mode: .activeAndBackground)
        
timer.eventHandler = {
   // handle elapsed time
}
        
timer.start()
timer.invalidate()

GitHub

link
Stars: 0
Last commit: 2 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

1.0.0 ❤️
2 years ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics