{"id":19805660,"url":"https://github.com/remirobert/notificationobserver","last_synced_at":"2026-05-09T23:32:26.140Z","repository":{"id":72989018,"uuid":"68587223","full_name":"remirobert/NotificationObserver","owner":"remirobert","description":"NotificationObserver","archived":false,"fork":false,"pushed_at":"2016-09-19T09:58:42.000Z","size":14,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-11T06:13:17.246Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/remirobert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2016-09-19T08:52:04.000Z","updated_at":"2017-01-20T17:58:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"6df14884-b5bb-4323-b5e0-384052889dfc","html_url":"https://github.com/remirobert/NotificationObserver","commit_stats":{"total_commits":6,"total_committers":2,"mean_commits":3.0,"dds":"0.33333333333333337","last_synced_commit":"4a1a493175d1a2d7aa02467db0b6301ac21fecad"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remirobert%2FNotificationObserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remirobert%2FNotificationObserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remirobert%2FNotificationObserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remirobert%2FNotificationObserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remirobert","download_url":"https://codeload.github.com/remirobert/NotificationObserver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241150244,"owners_count":19918334,"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":[],"created_at":"2024-11-12T09:04:52.727Z","updated_at":"2026-05-09T23:32:21.102Z","avatar_url":"https://github.com/remirobert.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NotificationObserver\n\n\n**NotificationObserver** is the *NSNotificationCenter* wrapper for **Swift3** 🎉.\n\nThis will make sure the adding and removing observers to the notification center is automatically managed.\nAdding is as simple as creating an object, and removing is as simple as deallocing that object.\n\n#Example\n\nHow to declare your notification : (**NotificationApp.swift**)\n\n```Swift\nimport NotificationObserver\n\nenum NotificationApp {\n    case Name\n    case UUID\n}\n\nextension NotificationApp: NotificationProtocol {\n    var name: String {\n        get {\n            switch self {\n            case .Name:\n                return \"name\"\n            case .UUID:\n                return \"uuid\"\n            }\n        }\n    }\n}\n```\n\nUsing observe a notification : \n\n```Swift\nimport NotificationObserver\n\nclass ViewController: UIViewController {\n\n    //the observer will be removed automatically when your UIViewController will be deallocated\n    //if you don't use a reference, abviously the observer will be directly deallocated\n    private var obs: NotificationObserver\u003cString\u003e!\n    \n    override func viewDidLoad() {\n        super.viewDidLoad()\n\n        self.obs = NotificationObserver(notification: NotificationApp.UUID, block: { uuid in\n            guard let uuid = uuid else {\n                return\n            }\n            print(\"suuid : \\(uuid)\")\n        })\n    }\n}\n```\n\nPost a notification somewhere : \n\n```Swift\nNotificationApp.UUID.post(UUID().uuidString)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremirobert%2Fnotificationobserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremirobert%2Fnotificationobserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremirobert%2Fnotificationobserver/lists"}