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

Overview

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

CocoaPods

pod 'AsyncTimer', '~> 2.2'

Carthage

github "Decybel07/AsyncTimer", ~> 2.2

Swift Package Manager

.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), [email protected]

🔑 License

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

You might also like...
Schedule timing task in Swift using a fluent API. (A friendly alternative to Timer)
Schedule timing task in Swift using a fluent API. (A friendly alternative to Timer)

Schedule(简体中文) Schedule is a timing tasks scheduler written in Swift. It allows you run timing tasks with elegant and intuitive syntax. Features Elega

Egg-Timer - Intermediate Swift Programming - Control Flow and Optionals

Egg-Timer Intermediate Swift Programming - Control Flow and Optionals What I lea

OpenFocusTimer - Pomodoro timer with categories, reflection, history & statistics

OpenFocusTimer Pomodoro timer with categories, reflection, history & statistics.

A simple network layer for use in small iOS projects with async/await support

SimpleNetwork Intro SimpleNetwork is simple network layer for use in small projects. Swift Package Manager Note: Instructions below are for using Swif

Example project showing how to use async/await with iOS 13
Example project showing how to use async/await with iOS 13

ios13AsyncAwait Example project showing how to use async/await with iOS 13 Article This source code is a part of an article published at This Dev Brai

SwiftyTimer allows you to instantly schedule delays and repeating timers using convenient closure syntax. It's time to get rid of Objective-C cruft.

SwiftyTimer Modern Swifty API for NSTimer SwiftyTimer allows you to instantly schedule delays and repeating timers using convenient closure syntax. It

Using async / await on iOS 13: everything you need to know
Using async / await on iOS 13: everything you need to know

Using async / await on iOS 13: everything you need to know! 🚀 Content This repository contains the code sample I've used during December 14th's lives

Pomodoro is a macOS status bar application written in SwiftUI, which allows you to control your work and break time, exploiting the pomodoro-technique.
Pomodoro is a macOS status bar application written in SwiftUI, which allows you to control your work and break time, exploiting the pomodoro-technique.

Pomodoro Pomodoro is a macOS status bar application which allows you to control your work and break time. Through this application you will be able to

A basic countdown app that allows the user to create, edit, and delete events. Each event contains a live countdown timer to a specified date and time.

Event Countdown App (iOS) Created by Lucas Ausberger About This Project Created: January 4, 2021 Last Updated: January 8, 2021 Current Verison: 1.1.1

A handy class for iOS to use UILabel as a countdown timer or stopwatch just like in Apple Clock App.
A handy class for iOS to use UILabel as a countdown timer or stopwatch just like in Apple Clock App.

MZTimerLabel Purpose MZTimerLabel is a UILabel subclass, which is a handy way to use UILabel as a countdown timer or stopwatch just like that in Apple

THORChain vault churn countdown timer for macOS tray
THORChain vault churn countdown timer for macOS tray

ChurnCountdown Useful macOS tray app to show THORChain churn countdown. On start

Tutorials from sparrowcode.io website. You can add new, translate or fix typos. Also you can add your apps from App Store for free.

Tutorials from sparrowcode.io website. You can add new, translate or fix typos. Also you can add your apps from App Store for free.

Tutorials from sparrowcode.io website. You can add new, translate or fix typos. Also you can add your apps from App Store for free.

Страницы доступны на sparrowcode.io/en & sparrowcode.io/ru Как добавить свое приложение Добавьте элемент в json /ru/apps/apps.json. Если ваше приложен

iOS app for Technex, IIT(BHU) Varanasi. This project is closed before completion. You can use this app for learning purpose. You can use this app as a templet of any event related app.
iOS app for Technex, IIT(BHU) Varanasi. This project is closed before completion. You can use this app for learning purpose. You can use this app as a templet of any event related app.

technex-ios iOS app for Technex, IIT(BHU) Varanasi. This project is closed before completion for some reasons. You can use this app for learning purpo

Arbitrary-precision arithmetic in pure Swift
Arbitrary-precision arithmetic in pure Swift

Overview API Documentation License Requirements and Integration Implementation Notes Full-width multiplication and division primitives Why is there no

Arbitrary precision fraction in Swift.

Fraction Arbitrary precision fraction in Swift. Usage Fraction can be converted from BinaryInteger, BinaryFloatingPoint or String. It supports nearly

The application is develop in Objective IOS. kids can draw whatever they want and also kids can save the drawing as well as undo erase the drawing.
The application is develop in Objective IOS. kids can draw whatever they want and also kids can save the drawing as well as undo erase the drawing.

IOSObjC_KidsBoard The application is develop in Objective IOS. kids can draw whatever they want and also kids can save the drawing as well as undo era

NavigationCoordinator acts as a coordinator for NavigationView in SwiftUI. You can use pushView, popView, popToView, popToRootView as you can in traditional UIKit

NavigationCoordinator NavigationCoordinator acts as a coordinator for NavigationView. You can use pushView, popView, popToView, popToRootView in Swift

Plugin-spell-timer - Spell Timer Plugin for Outlander

Spell Timer Plugin for Outlander This plugin provides variables for spells from

Comments
  • Fix Swift Package Manager

    Fix Swift Package Manager

    Currently, when trying to add AsyncTimer to my project via SPM, it fails on the "Resolving Package Dependencies" with this error:

    because every version of AsyncTimer contains incompatible tools version and root depends on AsyncTimer 2.2.0..<3.0.0, version solving failed.

    Some quick googling didn't provide a workaround for this; I'm not entirely sure what the issue is.

    opened by lukenewman 2
Releases(2.2.0)
Owner
Adrian Bobrowski
Adrian Bobrowski
Plugin-spell-timer - Spell Timer Plugin for Outlander

Spell Timer Plugin for Outlander This plugin provides variables for spells from

Outlander 0 Jan 22, 2022
GroupWork is an easy to use Swift framework that helps you orchestrate your concurrent, asynchronous functions in a clean and organized way

GroupWork is an easy to use Swift framework that helps you orchestrate your concurrent, asynchronous functions in a clean and organized way. This help

Quan Vo 42 Oct 5, 2022
Basic Stop Watch & Countdown app for iOS devices. Created for learning purpose.

stopwatch Basic Stop Watch (included Countdown feature) app for iOS devices. Created for learning purpose. How to use Just download source code and un

Jogendra 5 Jun 11, 2022
Egg Timer app helps you to cook your egg in the way you want

Egg Timer Egg Timer app helps you to cook your egg in the way you want. You need to decide on how do you want to eat your egg than just click the egg

Emrullah Cirit 2 Nov 29, 2022
Futures is a cross-platform framework for simplifying asynchronous programming, written in Swift.

Futures Futures is a cross-platform framework for simplifying asynchronous programming, written in Swift. It's lightweight, fast, and easy to understa

David Ask 60 Aug 11, 2022
Syntactic sugar in Swift for asynchronous dispatches in Grand Central Dispatch

Async Now more than syntactic sugar for asynchronous dispatches in Grand Central Dispatch (GCD) in Swift Async sugar looks like this: Async.userInitia

Tobias Due Munk 4.6k Dec 27, 2022
AwaitKit is a powerful Swift library which provides a powerful way to write asynchronous code in a sequential manner.

AwaitKit is a powerful Swift library inspired by the Async/Await specification in ES8 (ECMAScript 2017) which provides a powerful way to write asynchronous code in a sequential manner.

Yannick Loriot 752 Dec 5, 2022
Syntactic sugar in Swift for asynchronous dispatches in Grand Central Dispatch (iOS7+ and OS X 10.9+ compatible)

Async.legacy Syntactic sugar in Swift for asynchronous dispatches in Grand Central Dispatch (GCD) Async rewritten for iOS7 and OS X 10.9 Compatibility

Joseph Lord 31 Jul 1, 2019
Automatically generate GraphQL queries and decode results into Swift objects, and also interact with arbitrary GitHub API endpoints

GitHub API and GraphQL Client This package provides a generic GitHub API client (GithubApiClient) as well as Codable-like GitHub GraphQL querying and

Mike Lewis 4 Aug 6, 2022
GCDTimer - Well tested Grand Central Dispatch (GCD) Timer in Swift

GCDTimer Well tested Grand Central Dispatch (GCD) Timer in Swift. Checkout the test file. Usage Long running timer import GCDTimer

Hemant Sapkota 183 Sep 9, 2022