Decybel07 / AsyncTimer

AsyncTimer is a precision asynchronous timer. You can also use it as a countdown timer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AsyncTimer

Build Status CocoaPods Version Language Swift3 CocoaPods Platform CocoaPods License Docs percent Pod method Compatible codebeat badge Codacy Badge

🌟 Features

  • Can work as a countdown timer
  • Can work as a periodic Timer
  • Can work as a scheduled timer
  • Working with user events (like: scrolling, tapping, ...)
  • Functionality (start, pause, resume, stop, restart)
  • Support for clousure (never more selectors)

Overview

Countdown timer Periodic timer scheduled timer

πŸ’» Demo

pod try AsyncTimer

⚠️ Requirements

  • iOS 9.0+ | macOS 10.10+ | tvOS 9.0+ | watchOS 2.0+
  • Swift 3.0+

πŸ‘₯ Communication

  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

πŸ“— Installation

pod 'AsyncTimer', '~> 2.2'
github "Decybel07/AsyncTimer", ~> 2.2
.Package(url: "https://github.com/Decybel07/AsyncTimer.git", majorVersion: 2)

πŸ“˜ Usage

Import AsyncTimer at the top of each Swift file that will use framework.

import AsyncTimer

Countdown Timer

Counts down from 25 to 0 every 100 ms

AsyncTimer(
    interval: .milliseconds(100),
    times: 25,
    block: { value in
        print(value)
    }, 
    completion: { value in
        print("finished")
    }
)

Periodic Timer

Update every 100 ms

AsyncTimer(interval: .milliseconds(100), repeats: true) { 
    print("updated")
}

Scheduled Timer

Do something after 2 seconds

AsyncTimer(interval: .seconds(2)) {
    print("something to do")
}

πŸ€“ Author

Adrian Bobrowski (Decybel07), adrian071993@gmail.com

πŸ”‘ License

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

About

AsyncTimer is a precision asynchronous timer. You can also use it as a countdown timer

License:MIT License


Languages

Language:Swift 81.5%Language:Objective-C 9.9%Language:Ruby 8.6%