Times 1.0.0

Times 1.0.0

测试已测试
语言语言 SwiftSwift
许可证 MIT
发布最后发布2017 年 10 月
SwiftSwift 版本3.0
SPM支持 SPM

Omer Karisman 维护。



Times 1.0.0

Times

您可以轻松地运行一个代码块一次(或您想要执行的次数),而无需自己跟踪状态。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
Twitter Dribble Github

许可证

Times 在 MIT 许可证下提供。有关更多信息,请参阅 LICENSE 文件。