【文件属性】:
文件名称:ZYGCD计时器:GCD计时器
文件大小:27KB
文件格式:ZIP
更新时间:2021-02-03 03:40:23
ios objective-c timer gcdtimer Objective-CObjective-C
ZYGCDTimer
ZYGCDTimer主要用于替代NSTimer ,不会强持有目标,基于进行修改的,本质上是个GCD计时器。
产品特点
弱引用target
target销毁之后,自动调用invalidate
支持block创建定时器
支持设置GCD queue
支持暂停定时器
例
下载demo直接运行即可
要求
iOS 8.0以上
macOS 10.12以上
安装
ZYGCDTimer支持安装。在Podfile中Podfile以下文本,然后执行pod install就可以:
pod "ZYGCDTimer"
用法
使用target-selector创建计时器
+ ( instancetype )timerWithTimeInterval:( NSTimeInterval )interval
target:( id )aTarget
selector:( SEL )aSelector
【文件预览】:
ZYGCDTimer-master
----ZYGCDTimer.podspec(808B)
----LICENSE(1KB)
----ZYGCDTimer()
--------ZYGCDTimer.m(7KB)
--------ZYGCDTimer.h(2KB)
----fastlane()
--------Fastfile(85B)
--------README.md(1KB)
----ZYGCDTimerDemo()
--------Assets.xcassets()
--------main.m(337B)
--------GCDViewController.m(3KB)
--------AppDelegate.h(280B)
--------AppDelegate.m(2KB)
--------Base.lproj()
--------GCDViewController.h(261B)
--------ViewController.h(218B)
--------Info.plist(1KB)
--------ViewController.m(499B)
----.gitignore(1KB)
----zygcdtimer.png(6KB)
----README.md(2KB)
----ZYGCDTimerDemo.xcodeproj()
--------project.xcworkspace()
--------project.pbxproj(20KB)