Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mborsten/afterx
AfterX helps you keep track of things you only want to do once, or after x amount of times, during the application lifetime
https://github.com/mborsten/afterx
ios swift-3 swift3 xcode
Last synced: 25 days ago
JSON representation
AfterX helps you keep track of things you only want to do once, or after x amount of times, during the application lifetime
- Host: GitHub
- URL: https://github.com/mborsten/afterx
- Owner: mborsten
- License: mit
- Created: 2017-04-08T09:09:30.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-05-17T12:19:58.000Z (6 months ago)
- Last Synced: 2024-09-29T22:21:04.072Z (about 1 month ago)
- Topics: ios, swift-3, swift3, xcode
- Language: Swift
- Homepage:
- Size: 61.5 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# AfterX
[![Version](https://img.shields.io/cocoapods/v/AfterX.svg?style=flat)](http://cocoapods.org/pods/AfterX)
[![License](https://img.shields.io/cocoapods/l/AfterX.svg?style=flat)](http://cocoapods.org/pods/AfterX)
[![Platform](https://img.shields.io/cocoapods/p/AfterX.svg?style=flat)](http://cocoapods.org/pods/AfterX)AfterX uses the UserDefaults to keep track of tasks you have performed before. It keeps track of the tasks using the task identifier you give.
## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.
When you want to do something only once during the lifetime of the app:
```swift
AfterX.doOnce(task: "button_hint") {
self.showHint()
}
```When you want to do something once after the user has performed a task an x amount of times:
```swift
func calledWhenSucceedingTask() {...
AfterX.do(task: "ask_for_review", after: 5) {
self.askForReview()
}
}
```You can reset the count for a task:
```swift
AfterX.resetCount("my_task")
```Or reset the count for all tasks:
```swift
AfterX.resetAll()
```## Requirements
## Installation
AfterX is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod "AfterX"
```## Author
Marcel Borsten, [email protected]
## License
AfterX is available under the MIT license. See the LICENSE file for more info.