WallClock is small framework contains structures suitable for tracking clock progress. It does not take into account the dates.
The main purpose of WallClock is to deal easily with clock units. You can sum or subtract WallClock and compare them. It does not take into account the dates and it's by design. If you are going to compare two distinct clocks in order to say which one is displaying an earlier time you don't need to know the date. You can compare them in an absolute way due to a clock is something that take into account 24 * 3600 seconds. If you think about the clock as a flat timeline and a specific time a point onto the timeline, then you can compare them in an absolute way.
let midnight = WallClock.midnight
let clock = WallClock(hours: ClockHours(23), minutes: ClockMinutes(12), seconds: ClockSeconds(45))
let test1 = WallClock(0) == midnight
let test2 = midnight < clock
pod 'WallClock'
github "falcon283/WallClock"
- Gabriele Trabucco
This project is licensed under the MIT License - see the LICENSE file for details