https://github.com/meniny/every
⏱ Elegant Timer in Swift
https://github.com/meniny/every
ios swift timer
Last synced: about 1 year ago
JSON representation
⏱ Elegant Timer in Swift
- Host: GitHub
- URL: https://github.com/meniny/every
- Owner: Meniny
- License: mit
- Created: 2018-01-12T04:18:32.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-04-16T02:40:15.000Z (about 7 years ago)
- Last Synced: 2025-04-08T11:38:11.282Z (about 1 year ago)
- Topics: ios, swift, timer
- Language: Swift
- Size: 38.1 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Introduction
`Every` is an elegant timer in Swift.
## Requirements
* iOS 8.0+
* watchOS 2.0+
* tvOS 9.0+
* macOS 10.10+
* Xcode 9 with Swift 4
## Installation
#### CocoaPods
```ruby
use_frameworks!
pod 'Every'
```
## Usage
```swift
import Every
```
```swift
var counter = 0
Every(1).seconds.do { () -> Every.NextStep in
counter += 1
guard counter <= 4 else {
print("STOP")
return .stop
}
print(counter)
return .continue
}
// 1
// 2
// 3
// 4
// STOP
```