测试已测试 | ✗ |
语言语言 | SwiftSwift |
许可证 | MIT |
发布最后发布 | 2017 年 10 月 |
SwiftSwift 版本 | 3.0 |
SPM支持 SPM | ✗ |
由 Omer Karisman 维护。
您可以轻松地运行一个代码块一次(或您想要执行的次数),而无需自己跟踪状态。Times 会跟踪代码块被执行的次数,并决定是否根据您的偏好运行。
Times 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中
。
pod "Times"
Times.shared.once(forKey: "tutorial") {
// This gets executed once unless the user deletes and reinstalls
}
Times.shared.twice(forKey: "tutorial") {
// This gets executed two times unless the user deletes and reinstalls
}
Times.shared.times(8, forKey: "tutorial") {
// This gets executed eight times unless the user deletes and reinstalls
}
Times.shared.onceForSession(forKey: "tutorial") {
// This gets executed once. Count is zeroed when app restarts.
}
Times.shared.twiceForSession(forKey: "tutorial") {
// This gets executed two times. Count is zeroed when app restarts.
}
Times.shared.timesForSession(8, forKey: "tutorial") {
// This gets executed eight times. Count is zeroed when app restarts.
}
Omer Karisman MojiLaLa 的 UI/UX 领导 @ MojiLaLa |
---|
Times 在 MIT 许可证下提供。有关更多信息,请参阅 LICENSE 文件。