{"id":21092374,"url":"https://github.com/ripperhe/zygcdtimer","last_synced_at":"2025-05-16T13:32:41.132Z","repository":{"id":56931269,"uuid":"82038848","full_name":"ripperhe/ZYGCDTimer","owner":"ripperhe","description":"GCD 定时器","archived":false,"fork":false,"pushed_at":"2019-09-29T06:34:06.000Z","size":48,"stargazers_count":69,"open_issues_count":2,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-23T04:44:21.039Z","etag":null,"topics":["gcdtimer","ios","objective-c","timer"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ripperhe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-15T08:42:35.000Z","updated_at":"2023-03-15T05:10:33.000Z","dependencies_parsed_at":"2022-08-21T05:50:37.042Z","dependency_job_id":null,"html_url":"https://github.com/ripperhe/ZYGCDTimer","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ripperhe%2FZYGCDTimer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ripperhe%2FZYGCDTimer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ripperhe%2FZYGCDTimer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ripperhe%2FZYGCDTimer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ripperhe","download_url":"https://codeload.github.com/ripperhe/ZYGCDTimer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254538539,"owners_count":22087884,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gcdtimer","ios","objective-c","timer"],"created_at":"2024-11-19T21:53:47.432Z","updated_at":"2025-05-16T13:32:40.666Z","avatar_url":"https://github.com/ripperhe.png","language":"Objective-C","readme":"# ZYGCDTimer\n\n[![Version](https://img.shields.io/cocoapods/v/ZYGCDTimer.svg?style=flat)](http://cocoapods.org/pods/ZYGCDTimer)\n[![License](https://img.shields.io/cocoapods/l/ZYGCDTimer.svg?style=flat)](http://cocoapods.org/pods/ZYGCDTimer)\n[![Platform](https://img.shields.io/cocoapods/p/ZYGCDTimer.svg?style=flat)](http://cocoapods.org/pods/ZYGCDTimer)\n\nZYGCDTimer 主要用于替代 `NSTimer`，不会强持有 target，基于 [MSWeakTimer](https://github.com/mindsnacks/MSWeakTimer) 进行修改的，本质上是个 `GCD` 定时器。\n\n## Features\n\n- [x] 弱引用 `target`\n- [x] `target` 销毁之后，自动调用 `invalidate`\n- [x] 支持 `block` 创建定时器\n- [x] 支持设置 `GCD queue`\n- [x] 支持暂停定时器\n\n## Example\n\n![](zygcdtimer.png)\n\n下载 demo 直接运行即可\n\n## Requirements\n\n* iOS 8.0+\n* macOS 10.12+\n\n## Installation\n\nZYGCDTimer 支持 [CocoaPods](http://cocoapods.org) 安装。在 `Podfile` 中写入以下文本，然后执行 `pod install` 即可：\n\n```ruby\npod \"ZYGCDTimer\"\n```\n\n## Usage\n\n使用 `target-selector` 创建定时器\n\n```objc\n+ (instancetype)timerWithTimeInterval:(NSTimeInterval)interval\n                                       target:(id)aTarget\n                                     selector:(SEL)aSelector\n                                     userInfo:(nullable id)userInfo\n                                      repeats:(BOOL)repeats\n                                dispatchQueue:(dispatch_queue_t)dispatchQueue;\n```\n\n使用 `block` 创建定时器\n\n```objc\n+ (instancetype)timerWithTimeInterval:(NSTimeInterval)interval\n                                     userInfo:(nullable id)userInfo\n                                      repeats:(BOOL)repeats\n                                dispatchQueue:(dispatch_queue_t)dispatchQueue\n                                        block:(void (^)(ZYGCDTimer *timer))block;\n```\n\n启用定时器\n\n```objc\n- (void)fire;\n```\n\n无效定时器\n\n```objc\n- (void)invalidate;\n```\n\n暂停定时器\n\n```objc\n- (void)pause;\n```\n\n## Author\n\nripperhe, ripperhe@qq.com\n\n## License\n\nZYGCDTimer is available under the MIT license. See the LICENSE file for more info.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fripperhe%2Fzygcdtimer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fripperhe%2Fzygcdtimer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fripperhe%2Fzygcdtimer/lists"}