https://github.com/codeweaver13/hltimercenter
https://github.com/codeweaver13/hltimercenter
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/codeweaver13/hltimercenter
- Owner: CodeWeaver13
- License: mit
- Created: 2016-10-17T01:24:35.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-10-17T09:13:26.000Z (over 9 years ago)
- Last Synced: 2025-03-04T01:34:36.449Z (about 1 year ago)
- Language: Objective-C
- Size: 15.6 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HLTimerCenter
[](https://github.com/wangshiyu13/HLQRCodeScanner/blob/master/LICENSE)
[](https://travis-ci.org/wangshiyu13/HLQRCodeScanner)
[](http://cocoapods.org/?q= HLQRCodeScanner)
[](https://www.apple.com/nl/ios/)
#### 基于GCD的定时管理器
##特点
1. 基于GCD实现的定时器,稳定好用
2. 提供Center进行定时器统一管理
3. 当APP进入后台时自动暂停所有定时器,APP恢复时统一唤醒
====
##使用方法
1) 直接创建
```objective-c
[[HLTimerCenter defaultCenter] createTimer:1 afterTime:0 repeatsCount:5 repeats:NO autoPlay:YES handler:^{
NSLog(@"泡一下");
}];
```
2) 分步创建
```objective-c
HLTimer *timer = [[HLTimer alloc] initWithTime:1 andAfterTime:0 andRepeatsCount:5 isRepeats:NO completionHandler:^{
NSLog(@"跑一下");
}];
[[HLTimerCenter defaultCenter] addTimer:timer autoPlay:NO];
```
## 环境要求
该库需运行在 iOS 8.0 和 Xcode 7.0以上环境.
## 集成方法
HLTimerCenter is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod "HLTimerCenter"
```
## 作者
wangshiyu13, wangshiyu13@163.com
## 开源协议
HLNetworking is available under the MIT license. See the LICENSE file for more info.