All Projects → ripperhe → ZYGCDTimer

ripperhe / ZYGCDTimer

Licence: MIT license
GCD 定时器

Programming Languages

objective c
16641 projects - #2 most used programming language
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to ZYGCDTimer

flitter
A Livesplit-inspired speedrunning split timer for Linux/macOS terminal. Supports global hotkeys.
Stars: ✭ 112 (+72.31%)
Mutual labels:  timer
use-countdown-timer
React hook exposing a countdown timer with optional expiration reset callbacks
Stars: ✭ 31 (-52.31%)
Mutual labels:  timer
CoreLooper
No description or website provided.
Stars: ✭ 34 (-47.69%)
Mutual labels:  timer
cya
Easy to use snapshot and restore utility for any Linux (Unix) OS and filesystem powered by BASH
Stars: ✭ 73 (+12.31%)
Mutual labels:  timer
clappr-plugins
Main plugins for the Clappr project
Stars: ✭ 22 (-66.15%)
Mutual labels:  timer
Tiny-Timer
Simple timer desktop app using electron
Stars: ✭ 51 (-21.54%)
Mutual labels:  timer
asynctimerqueue
Asynchronous timer queue mechanism(C++11)
Stars: ✭ 21 (-67.69%)
Mutual labels:  timer
FITTER
Fortran tIc Toc Timer
Stars: ✭ 14 (-78.46%)
Mutual labels:  timer
tiny-timer
🕑 Small countdown timer and stopwatch module.
Stars: ✭ 39 (-40%)
Mutual labels:  timer
chronoman
Utility class to simplify use of timers created by setTimeout
Stars: ✭ 15 (-76.92%)
Mutual labels:  timer
ioBroker.smartcontrol
Control devices smarter: by grouping, including triggers like motion, opening window, etc. and set target devices accordingly
Stars: ✭ 20 (-69.23%)
Mutual labels:  timer
circlebars
Add circular progress bars and countdown timers easily with circlebars Created by @itaditya. Demo at >
Stars: ✭ 38 (-41.54%)
Mutual labels:  timer
codeforces-timer
A Google Chrome extension which adds a timer to practice timed problem solving on codeforces
Stars: ✭ 20 (-69.23%)
Mutual labels:  timer
wht
Working Hours Tracker for Sailfish OS
Stars: ✭ 20 (-69.23%)
Mutual labels:  timer
UT Framework
Various advanced tools built for Unreal Engine 4
Stars: ✭ 45 (-30.77%)
Mutual labels:  timer
animedoro-timer
An Animedoro timer for all the weebs out there | productivity : 📈
Stars: ✭ 37 (-43.08%)
Mutual labels:  timer
time-tracker-cli
Super tiny and ligthway time tracker for all cli lovers
Stars: ✭ 79 (+21.54%)
Mutual labels:  timer
hass-variables
Home Assistant variables component
Stars: ✭ 35 (-46.15%)
Mutual labels:  timer
ZLToolKit
一个基于C++11的轻量级网络框架,基于线程池技术可以实现大并发网络IO
Stars: ✭ 1,302 (+1903.08%)
Mutual labels:  timer
PHPBenchTime
A lightweight benchmark timer for PHP
Stars: ✭ 26 (-60%)
Mutual labels:  timer

ZYGCDTimer

Version License Platform

ZYGCDTimer 主要用于替代 NSTimer,不会强持有 target,基于 MSWeakTimer 进行修改的,本质上是个 GCD 定时器。

Features

  • 弱引用 target
  • target 销毁之后,自动调用 invalidate
  • 支持 block 创建定时器
  • 支持设置 GCD queue
  • 支持暂停定时器

Example

下载 demo 直接运行即可

Requirements

  • iOS 8.0+
  • macOS 10.12+

Installation

ZYGCDTimer 支持 CocoaPods 安装。在 Podfile 中写入以下文本,然后执行 pod install 即可:

pod "ZYGCDTimer"

Usage

使用 target-selector 创建定时器

+ (instancetype)timerWithTimeInterval:(NSTimeInterval)interval
                                       target:(id)aTarget
                                     selector:(SEL)aSelector
                                     userInfo:(nullable id)userInfo
                                      repeats:(BOOL)repeats
                                dispatchQueue:(dispatch_queue_t)dispatchQueue;

使用 block 创建定时器

+ (instancetype)timerWithTimeInterval:(NSTimeInterval)interval
                                     userInfo:(nullable id)userInfo
                                      repeats:(BOOL)repeats
                                dispatchQueue:(dispatch_queue_t)dispatchQueue
                                        block:(void (^)(ZYGCDTimer *timer))block;

启用定时器

- (void)fire;

无效定时器

- (void)invalidate;

暂停定时器

- (void)pause;

Author

ripperhe, [email protected]

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].