https://github.com/drenhart/mcgcdtimer
GCD定时器的简单封装(GCD timer simple package)
https://github.com/drenhart/mcgcdtimer
gcdtimer swift swift3 swift4
Last synced: 5 months ago
JSON representation
GCD定时器的简单封装(GCD timer simple package)
- Host: GitHub
- URL: https://github.com/drenhart/mcgcdtimer
- Owner: drenhart
- Created: 2018-01-22T07:12:05.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-23T07:11:03.000Z (over 8 years ago)
- Last Synced: 2025-09-08T12:53:37.937Z (11 months ago)
- Topics: gcdtimer, swift, swift3, swift4
- Language: Swift
- Homepage:
- Size: 10.7 KB
- Stars: 10
- Watchers: 4
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MCGCDTimer
GCD定时器的简单封装
采用Swift4语言编写,使用时直接将MCGCDTimer类拖到工程中就可以了.
### 使用
- 开始定时器
MCGCDTimer.shared.scheduledDispatchTimer(WithTimerName: "GCDTimer", timeInterval: 1, queue: .main, repeats: true) {
//需要执行的代码
}
- 取消定时器
MCGCDTimer.shared.cancleTimer(WithTimerName: "GCDTimer")
- 检查定时器是否存在
MCGCDTimer.shared.isExistTimer(WithTimerName: "GCDTimer")
# MCGCDTimer
GCD timer simple package
Written using Swift4 language, when used directly drag class MCGCDTimer to your project.
### Usage
- Begin Timer
MCGCDTimer.shared.scheduledDispatchTimer(WithTimerName: "GCDTimer", timeInterval: 1, queue: .main, repeats: true) {
//code need to be execute
}
- Cancel Timer
MCGCDTimer.shared.cancleTimer(WithTimerName: "GCDTimer")
- Check if the timer exists
MCGCDTimer.shared.isExistTimer(WithTimerName: "GCDTimer")