{"id":19809513,"url":"https://github.com/space-code/nexus","last_synced_at":"2025-02-28T12:45:18.719Z","repository":{"id":79213905,"uuid":"593889319","full_name":"space-code/nexus","owner":"space-code","description":"A watch connectivity wrapper","archived":false,"fork":false,"pushed_at":"2023-09-19T14:57:07.000Z","size":319,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2025-02-11T18:15:30.797Z","etag":null,"topics":["ios","swift","swift-package-manager","watchos"],"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/space-code.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-27T04:11:20.000Z","updated_at":"2023-10-11T14:44:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"6c0a63df-58ba-4c18-9f62-34f81d4542bb","html_url":"https://github.com/space-code/nexus","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/space-code%2Fnexus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/space-code%2Fnexus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/space-code%2Fnexus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/space-code%2Fnexus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/space-code","download_url":"https://codeload.github.com/space-code/nexus/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241152772,"owners_count":19918680,"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":["ios","swift","swift-package-manager","watchos"],"created_at":"2024-11-12T09:17:14.985Z","updated_at":"2025-02-28T12:45:18.709Z","avatar_url":"https://github.com/space-code.png","language":"Swift","readme":"![Nexus: AW and iPhone Communication Service](https://raw.githubusercontent.com/space-code/nexus/main/Resources/nexus.png)\n\n\u003ch1 align=\"center\" style=\"margin-top: 0px;\"\u003enexus\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/space-code/nexus/blob/main/LICENSE\"\u003e\u003cimg alt=\"License\" src=\"https://img.shields.io/github/license/space-code/nexus?style=flat\"\u003e\u003c/a\u003e \n\u003ca href=\"https://developer.apple.com/\"\u003e\u003cimg alt=\"Platform\" src=\"https://img.shields.io/badge/platform-ios%20%7C%20osx%20%7C%20watchos%20%7C%20tvos-%23989898\"/\u003e\u003c/a\u003e \n\u003ca href=\"https://developer.apple.com/swift\"\u003e\u003cimg alt=\"Swift5.7\" src=\"https://img.shields.io/badge/language-Swift5.7-orange.svg\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/space-code/concurrency\"\u003e\u003cimg alt=\"CI\" src=\"https://github.com/space-code/nexus/actions/workflows/ci.yml/badge.svg?branch=main\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/apple/swift-package-manager\" alt=\"Nexus on Swift Package Manager\"\u003e\u003cimg src=\"https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://codecov.io/gh/space-code/nexus\"\u003e\u003cimg alt=\"CodeCov\" src=\"https://codecov.io/github/space-code/nexus/graph/badge.svg?token=4MP7MPTQS5\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Description\nNexus is a wrapper around `WatchConnectivity` that simplifies the interaction between watchOS and iOS.\n\n- [Usage](#usage)\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Communication](#communication)\n- [Contributing](#contributing)\n- [Author](#author)\n- [License](#license)\n\n## Usage\n\n1. Define a message model like this:\n```swift\nimport Nexus\n\nstruct TestMessage: Message {\n  static let identifier: String {\n    return \"TestModel\"\n  }\n}\n```\n\n2. Create an instance of the `CommunicationService` and subscribe to receive messages:\n```swift\nimport Nexus\n\nvar disposables = Set\u003cAnyCancellable\u003e()\nlet communicationService = CommunicationService()\ncommunicationService.receiveMessage(TestMessage.self)\n  .sink(receiveCompletion: { result in \n    if case let .failure(error) = result {\n      // something went wrong\n    }, receiveValue: { message in \n      debugPrint(message)\n    }\n  })\n  .store(in: \u0026disposables)\n```\n\n3. Send a message to Apple Watch or iPhone:\n```swift\nimport Nexus\n\nlet message = TestMessage()\ncommunicationService.sendMessage(message)\n```\n\n## Requirements\n- iOS 13.0+ / watchOS 7.0+\n- Xcode 14.0\n- Swift 5.7\n\n## Installation\n### Swift Package Manager\n\nThe [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler. It is in early development, but `nexus` does support its use on supported platforms.\n\nOnce you have your Swift package set up, adding `nexus` as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/space-code/nexus.git\", .upToNextMajor(from: \"2.0.0\"))\n]\n```\n\n## Communication\n- If you **found a bug**, open an issue.\n- If you **have a feature request**, open an issue.\n- If you **want to contribute**, submit a pull request.\n\n## Contributing\nBootstrapping development environment\n\n```\nmake bootstrap\n```\n\nPlease feel free to help out with this project! If you see something that could be made better or want a new feature, open up an issue or send a Pull Request!\n\n## Author\nNikita Vasilev, nv3212@gmail.com\n\n## License\nnexus 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%2Fspace-code%2Fnexus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspace-code%2Fnexus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspace-code%2Fnexus/lists"}