{"id":1823,"url":"https://github.com/msaps/Listenable","last_synced_at":"2025-08-02T04:32:40.121Z","repository":{"id":62446562,"uuid":"78525042","full_name":"msaps/Listenable","owner":"msaps","description":"🎧 Protocol driven object observation","archived":true,"fork":false,"pushed_at":"2018-03-19T10:48:17.000Z","size":87,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-18T13:46:39.720Z","etag":null,"topics":["ios","listener","observable","observer","reactive","swift"],"latest_commit_sha":null,"homepage":"http://sapsford.tech","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/msaps.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-01-10T10:56:20.000Z","updated_at":"2023-08-22T09:39:41.000Z","dependencies_parsed_at":"2022-11-01T23:00:56.757Z","dependency_job_id":null,"html_url":"https://github.com/msaps/Listenable","commit_stats":null,"previous_names":["merricksapsford/listenable"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/msaps/Listenable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msaps%2FListenable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msaps%2FListenable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msaps%2FListenable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msaps%2FListenable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msaps","download_url":"https://codeload.github.com/msaps/Listenable/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msaps%2FListenable/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268334618,"owners_count":24233793,"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","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ios","listener","observable","observer","reactive","swift"],"created_at":"2024-01-05T20:15:56.657Z","updated_at":"2025-08-02T04:32:39.856Z","avatar_url":"https://github.com/msaps.png","language":"Swift","funding_links":[],"categories":["Reactive Programming"],"sub_categories":["Other free courses","Prototyping","Other Parsing"],"readme":"# Listenable\n[![Build Status](https://travis-ci.org/msaps/Listenable.svg?branch=master)](https://travis-ci.org/msaps/Listenable)\n[![Swift 4](https://img.shields.io/badge/Swift-4-orange.svg?style=flat)](https://developer.apple.com/swift/)\n[![CocoaPods](https://img.shields.io/cocoapods/v/Listenable.svg)]()\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![codecov](https://codecov.io/gh/msaps/Listenable/branch/master/graph/badge.svg)](https://codecov.io/gh/msaps/Listenable)\n[![GitHub release](https://img.shields.io/github/release/msaps/Listenable.svg)](https://github.com/msaps/Listenable/releases)\n\nSwift object that provides an observable platform for multiple listeners.\n\n## Requirements\n- iOS 9.0+\n- Xcode 9.x+\n- Swift 4\n\n## Installation\nListenable is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your Podfile:\n```ruby\n    pod 'Listenable'\n```\nAnd run `pod install`.\n\n## Usage\nCreate a Listenable object either by inheriting or initializing a Listenable typed with a protocol:\n\n```swift\n    class ListenableObject: Listenable\u003cListenableDelegate\u003e {\n      // Class\n    }\n```\n\nYou can then add and remove listeners, and update them as required...\n\nAdd Listener(s):\n```swift\n\tadd(listener: Listener, priority: ListenerPriority) -\u003e Bool\n\tadd(listeners: [Listener], priority: ListenerPriority) -\u003e Void\n```\nRemove Listener(s):\n```swift\n\tremove(listener: Listener) -\u003e Bool\n\tremove(listeners: [Listener]) -\u003e Void\n\tremoveAllListeners()\n```\nEnumerate \u0026 Update Listeners:\n```swift\n\tupdateListeners(update: (listener: Listener, index: Int) -\u003e Void)\n```\n\n#### Prioritisation\n`ListenerPriority` allows for definition of enumeration priority for a listener; by default the `priority` parameter is set to `.low`. The following values can be assigned:\n```swift\n\t.low \t\t(Raw: 0)\n\t.high \t\t(Raw: 1000)\n\t.custom\t\t(Valid range: 0-1000)\n```\n\nListeners can also be updated exclusively relative to their priority:\n```swift\n\tupdateListeners(withPriority: ListenerPriority?, \n\t\t\t\t    \t  update: (listener: Listener, index: Int) -\u003e Void)\n\t\t\t\t\t   \n\tupdateListeners(withPriorities: ClosedRange\u003cInt\u003e?, \n\t\t\t\t    \t    update: (listener: Listener, index: Int) -\u003e Void)\n```\n\n## Contributing\nBug reports and pull requests are welcome on GitHub at https://github.com/MerrickSapsford/Listenable.\n\n## License\n\nThe library is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsaps%2FListenable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsaps%2FListenable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsaps%2FListenable/lists"}