RepoName
遇见
🏵 简介
RepoName是一个小型库,简化了使用`Date`的使用。用Swift编写。
📋 需求
类型 | 需求 | |
---|---|---|
平台 |
iOS |
8.0+ |
macOS |
10.10 |
|
tvOS |
9.0 |
|
watchOS |
2.0 |
|
Linux |
不适用 |
|
IDE |
Xcode |
9.3+ |
语言 |
Swift |
4.1+ |
📲 安装
手动
将RepoName
目录中的所有文件复制到您的项目中。
🛌 依赖
不适用
❤️ 贡献
欢迎fork并提交pull请求。
🔖 许可
RepoName
是开源软件,许可协议为MIT
许可。
🔫 用法
import RepoName
let now = Date()
print("now: \(now)")
print("now.isToday: \(now.isToday)")
print("now.isWeekend: \(now.isWeekend)")
print("now is: \(now.weekdayName.name)")
let nextDay = now.adding(days: 1)
print("nextDay: \(nextDay)")
print("nextDay.isTomorrow: \(nextDay.isTomorrow)")
let later = Today.compare(date: nextDay, ifLater: now)
print("nextDay is isLaterThan now: \(later)")
let todayInNextYear = Today.dateByAdding(1, of: .year, to: now)
print("todayInNextYear: \(String(describing: todayInNextYear))")