Times 1.0.0

Times 1.0.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Oct 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by Omer Karisman.



Times 1.0.0

Times

You can easily run a codeblock once (or as many times you want) without having to track the status yourself. Times tracks the number of times the block gets executed and decides wheter to run or not on your preference.

Installation

Times is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "Times"

Usage


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.
}

Author

Omer Karisman

Lead UI/UX @ MojiLaLa
Twitter Dribble Github

License

Times is available under the MIT license. See the LICENSE file for more info.