{"id":29536767,"url":"https://github.com/noppefoxwolf/messagenotification","last_synced_at":"2026-05-16T13:03:41.411Z","repository":{"id":304338853,"uuid":"1018383498","full_name":"noppefoxwolf/MessageNotification","owner":"noppefoxwolf","description":"A Swift package that provides type-safe message passing extensions for NotificationCenter with async/await support","archived":false,"fork":false,"pushed_at":"2025-07-12T12:06:01.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-12T13:26:20.300Z","etag":null,"topics":["async-await","ios","macos","message-passing","notificationcenter","swift","swift-package","type-safety"],"latest_commit_sha":null,"homepage":null,"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/noppefoxwolf.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,"zenodo":null}},"created_at":"2025-07-12T06:28:05.000Z","updated_at":"2025-07-12T12:06:03.000Z","dependencies_parsed_at":"2025-07-12T13:39:07.417Z","dependency_job_id":null,"html_url":"https://github.com/noppefoxwolf/MessageNotification","commit_stats":null,"previous_names":["noppefoxwolf/messagenotification"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/noppefoxwolf/MessageNotification","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noppefoxwolf%2FMessageNotification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noppefoxwolf%2FMessageNotification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noppefoxwolf%2FMessageNotification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noppefoxwolf%2FMessageNotification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noppefoxwolf","download_url":"https://codeload.github.com/noppefoxwolf/MessageNotification/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noppefoxwolf%2FMessageNotification/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265562379,"owners_count":23788518,"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":["async-await","ios","macos","message-passing","notificationcenter","swift","swift-package","type-safety"],"created_at":"2025-07-17T03:09:31.274Z","updated_at":"2026-05-16T13:03:41.381Z","avatar_url":"https://github.com/noppefoxwolf.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MessageNotification\n\n[![Tests](https://github.com/noppefoxwolf/MessageNotification/actions/workflows/test.yml/badge.svg)](https://github.com/noppefoxwolf/MessageNotification/actions/workflows/test.yml)\n\nA Swift package that provides type-safe message passing extensions for NotificationCenter with async/await support.\n\nThis is a backport of the iOS 26 NotificationCenter Message extensions for earlier versions.\n\n## Features\n\n- Type-safe message protocol for NotificationCenter\n- Async/await observer pattern\n- Automatic observation token management\n- Cross-platform support (iOS 17+, macOS 14+)\n\n## Installation\n\nAdd the package to your `Package.swift`:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/noppefoxwolf/MessageNotification\", from: \"1.0.0\")\n]\n```\n\n## Usage\n\n### Define a Message Type\n\n```swift\nstruct MyMessage: NotificationCenter._AsyncMessage {\n    typealias Subject = MyViewController\n    \n    static let name = Notification.Name(\"MyMessage\")\n    let data: String\n    \n    static func makeMessage(_ notification: Notification) -\u003e Self? {\n        guard let data = notification.userInfo?[\"data\"] as? String else { return nil }\n        return MyMessage(data: data)\n    }\n    \n    static func makeNotification(_ message: Self) -\u003e Notification {\n        return Notification(name: name, userInfo: [\"data\": message.data])\n    }\n}\n```\n\n### Observe Messages\n\n```swift\nlet token = NotificationCenter.default.addObserver(\n    of: viewController,\n    for: MyMessage.self\n) { message in\n    print(\"Received: \\(message.data)\")\n}\n```\n\n### Post Messages\n\n```swift\nlet message = MyMessage(data: \"Hello World\")\nNotificationCenter.default.post(message, subject: viewController)\n```\n\n## Requirements\n\n- iOS 17.0+ / macOS 14.0+\n- Swift 6.1+\n\n## License\n\nThis project is available under the MIT license.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoppefoxwolf%2Fmessagenotification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoppefoxwolf%2Fmessagenotification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoppefoxwolf%2Fmessagenotification/lists"}