{"id":22126545,"url":"https://github.com/kiarashvosough1999/closured","last_synced_at":"2025-07-25T16:33:37.852Z","repository":{"id":45369090,"uuid":"439276916","full_name":"kiarashvosough1999/Closured","owner":"kiarashvosough1999","description":"New Way Of Working Around With Closures.","archived":false,"fork":false,"pushed_at":"2021-12-17T09:28:47.000Z","size":22,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-19T10:56:36.672Z","etag":null,"topics":["closure","concurrency","dispatchqueue","foundation","ios","property-wrapper","swift","xcode"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/kiarashvosough1999.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":"2021-12-17T09:23:48.000Z","updated_at":"2022-09-18T09:10:30.000Z","dependencies_parsed_at":"2022-08-20T19:20:13.448Z","dependency_job_id":null,"html_url":"https://github.com/kiarashvosough1999/Closured","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiarashvosough1999%2FClosured","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiarashvosough1999%2FClosured/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiarashvosough1999%2FClosured/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiarashvosough1999%2FClosured/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kiarashvosough1999","download_url":"https://codeload.github.com/kiarashvosough1999/Closured/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227598457,"owners_count":17791605,"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":["closure","concurrency","dispatchqueue","foundation","ios","property-wrapper","swift","xcode"],"created_at":"2024-12-01T16:58:54.243Z","updated_at":"2024-12-01T16:58:55.001Z","avatar_url":"https://github.com/kiarashvosough1999.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Closured\n\n[![Swift](https://img.shields.io/badge/Swift-5.1_or_Higher-orange?style=flat-square)](https://img.shields.io/badge/Swift-5.1_5.2_5.3_5.4-Orange?style=flat-square)\n[![Platforms](https://img.shields.io/badge/Platforms-iOS_9_or_Higher-yellowgreen?style=flat-square)](https://img.shields.io/badge/Platforms-macOS_iOS_tvOS_watchOS_Linux_Windows-Green?style=flat-square)\n[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/Alamofire.svg?style=flat-square)](https://img.shields.io/cocoapods/v/Alamofire.svg)\n[![Twitter](https://img.shields.io/badge/twitter-@Vosough_k-blue.svg?style=flat-square)](https://twitter.com/AlamofireSF)\n[![Build Status](https://travis-ci.org/joemccann/dillinger.svg?branch=master)](https://travis-ci.org/joemccann/dillinger)\n\n\nNew Way Of Working Around With Closures.\n\n**Are you tired of old-school callback closures?**\n\n**Are you always mess up with capturing references on async closures?**\n \n**Then Using Closured Will Bring You New Style.**\n\n- [Features](#features)\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [SampleProjects](#Sample)\n- [Usage](#Usage)\n- [Contributors](#Contributors)\n- [License](#license)\n\n## Features\n\n- [x] Use propertyWrapper To Wrap Closure\n- [x] Captures Weak References Inside Closure\n- [x] Perform Closure On Different Queues\n- [x] Fully Error Handled On Performing Closure\n- [ ] Fully Documented With DocC\n- [ ] Provide UnitTest\n\n## Requirements\n\n| Platform | Minimum Swift Version | Installation | Status |\n| --- | --- | --- | --- |\n| iOS 9.0+ | 5.3 | [CocoaPods](#cocoapods) | Tested |\n\n## Installation\n\n### CocoaPods\n\n[CocoaPods](https://cocoapods.org) is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate Closured into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n```ruby\npod 'Closured'\n```\n\n## Sample\n\nI have provided one sample project in the repository. To use it clone the repo, Source files for these are in the `Example` directory in project navigator. Have fun!\n\n## Usage\n\nUsing Closured is so easy, It uses `PropertyWrapper` in swift.\n\nYou just need to annotate your closures with provided Wrappers.\n\n```swift\n\nimport Closured\n\nclass Example {\n\n\t// provide queue or the default is main\n\t// all the method without queue will use this queue to perform\n\t@Closured(queue: .main) var voidCallBack: (() -\u003e Void)?\n\t\n\t@Closured10(queue: .main) var intCallBack: ((Int) -\u003e Void)?\n\t\n\tprivate func call() {\n\t\ttry? voidCallBack.sync() // perform on Main Queue\n\t\t\n\t\ttry? voidCallBack.sync(on: .global(.background)) // perform on global Queue\n\t\t\n\t\ttry? voidCallBack.async() // perform on Main Queue\n\t\t\n\t\ttry? voidCallBack.async(on: .global(.utility)) \n\t\t\n\t\t\n\t\ttry? intCallBack.sync(on: .global(.utility), 89) \n\t\t\n\t\ttry? intCallBack.async(10) // perform on Main Queue\n\t}\n}\n\nclass Container {\n\t\n\tprivate let ref = Example()\n\t\n\tfunc bind() {\n\t\tref.$voidCallBack.byWrapping(self) { strongSelf in\n\t\t\t// strongSelf is unwrapped reference to self\n\t\t\t// self is not retained\n\t\t\t// this closure won't be executed if self was deallocated\n\t\t}\n\t\t\n\t\tref.$intCallBack.byWrapping(self) { strongSelf, integer in\n\t\t\t// strongSelf is unwrapped reference to self\n\t\t\t// self is not retained\n\t\t\t// this closure won't be executed if self was deallocated\n\t\t\t// this closure will be called twice in two different queue, and provide 2 numbers = 89 and 10 \n\t\t}\n\t}\n}\n\n```\n\n\n## Contributors\n\nFeel free to share your ideas or any other problems. Pull requests are welcomed.\n\n## License\n\nCocoAttributedStringBuilder is released under an MIT license. See [LICENSE](https://github.com/kiarashvosough1999/Closured/blob/master/LICENSE) for more information.\n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiarashvosough1999%2Fclosured","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkiarashvosough1999%2Fclosured","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiarashvosough1999%2Fclosured/lists"}