{"id":21031843,"url":"https://github.com/zekunyan/ttgdealloctaskhelper","last_synced_at":"2025-08-18T10:23:43.294Z","repository":{"id":56923316,"uuid":"63520944","full_name":"zekunyan/TTGDeallocTaskHelper","owner":"zekunyan","description":"NSObject Category to add callback tasks when object dealloc.","archived":false,"fork":false,"pushed_at":"2017-03-12T08:46:30.000Z","size":42,"stargazers_count":29,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-21T21:21:50.782Z","etag":null,"topics":["dealloc","dealloc-tasks","ios","objective-c"],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/zekunyan.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":"2016-07-17T07:56:34.000Z","updated_at":"2023-04-25T07:02:44.000Z","dependencies_parsed_at":"2022-08-20T22:10:05.238Z","dependency_job_id":null,"html_url":"https://github.com/zekunyan/TTGDeallocTaskHelper","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zekunyan%2FTTGDeallocTaskHelper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zekunyan%2FTTGDeallocTaskHelper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zekunyan%2FTTGDeallocTaskHelper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zekunyan%2FTTGDeallocTaskHelper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zekunyan","download_url":"https://codeload.github.com/zekunyan/TTGDeallocTaskHelper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254341076,"owners_count":22054981,"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":["dealloc","dealloc-tasks","ios","objective-c"],"created_at":"2024-11-19T12:32:55.127Z","updated_at":"2025-05-15T12:31:19.371Z","avatar_url":"https://github.com/zekunyan.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TTGDeallocTaskHelper\n\n[![CI Status](http://img.shields.io/travis/zekunyan/TTGDeallocTaskHelper.svg?style=flat)](https://travis-ci.org/zekunyan/TTGDeallocTaskHelper)\n[![Version](https://img.shields.io/cocoapods/v/TTGDeallocTaskHelper.svg?style=flat)](http://cocoapods.org/pods/TTGDeallocTaskHelper)\n[![License](https://img.shields.io/cocoapods/l/TTGDeallocTaskHelper.svg?style=flat)](http://cocoapods.org/pods/TTGDeallocTaskHelper)\n[![Platform](https://img.shields.io/cocoapods/p/TTGDeallocTaskHelper.svg?style=flat)](http://cocoapods.org/pods/TTGDeallocTaskHelper)\n\n## What\n\nTTGDeallocTaskHelper is useful to perform tasks after object dealloc.\n\n## Requirements\n\n* iOS 7\n* macOS 10.8\n* tvOS 9.0\n* watchOS 2.0\n\n## Installation\n\nTTGDeallocTaskHelper is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod \"TTGDeallocTaskHelper\"\n```\n\n## Usage\n```\n#import \"NSObject+TTGDeallocTaskHelper.h\"\n\n// Some object\nid object;\n        \n// Add dealloc task\n[object ttg_addDeallocTask:^(__unsafe_unretained id object, NSUInteger identifier) {\n    // After object dealloc, do you job.\n    // ...\n}];\n\n// object has been released. And the tasks will be performed.\nobject = nil;\n```\n\n\n## API\nCallback block definition.  \n\n```\ntypedef void (^TTGDeallocTaskBlock)(__unsafe_unretained id object, NSUInteger identifier);\n```\n\nAdd dealloc task.\n```\n/**\n *  Add dealloc task to object.\n *\n *  @param taskBlock The dealloc task\n *\n *  @return The task identifier\n */\n- (NSUInteger)ttg_addDeallocTask:(TTGDeallocTaskBlock)taskBlock;\n```\n\nRemove specific task by identifier.\n```\n/**\n *  Remove task by identifier.\n *\n *  @param identifier The task identifier\n *\n *  @return Remove success or not\n */\n- (BOOL)ttg_removeDeallocTaskByIdentifier:(NSUInteger)identifier;\n```\n\nRemove all dealloc tasks.\n```\n/**\n *  Remove all dealloc tasks.\n */\n- (void)ttg_removeAllDeallocTasks;\n```\n\n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n## Author\n\nzekunyan, zekunyan@163.com\n\n## License\n\nTTGDeallocTaskHelper is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzekunyan%2Fttgdealloctaskhelper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzekunyan%2Fttgdealloctaskhelper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzekunyan%2Fttgdealloctaskhelper/lists"}