项目作者: mokagio

项目描述 :
Generic decorator for timestamp information.
高级语言: Swift
项目地址: git://github.com/mokagio/Timestamped.git
创建时间: 2019-07-23T10:48:09Z
项目社区:https://github.com/mokagio/Timestamped

开源协议:MIT License

下载


Timestamped ⏱

A generic type to decorate a given value with timestamp information.

  1. let resource: Timestamped<Resource> = getResource()
  2. if resource.createdBefore(Date.yesterady) {
  3. print("Old resource. Needs refresh")
  4. } else {
  5. print("Still fresh: resource is \(resource.value)")
  6. }