{"id":23168835,"url":"https://github.com/chris-huxtable/cbhwindowmanager","last_synced_at":"2025-08-17T21:13:28.709Z","repository":{"id":56904218,"uuid":"202267289","full_name":"chris-huxtable/CBHWindowManager","owner":"chris-huxtable","description":"An easy-to-use singleton which manages `NSWindow` and `NSWindowController` objects","archived":false,"fork":false,"pushed_at":"2019-11-27T21:52:52.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-11T06:50:32.859Z","etag":null,"topics":["objective-c","objective-c-library","window-manager"],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chris-huxtable.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":"2019-08-14T03:26:52.000Z","updated_at":"2019-11-27T21:52:54.000Z","dependencies_parsed_at":"2022-08-21T01:50:54.585Z","dependency_job_id":null,"html_url":"https://github.com/chris-huxtable/CBHWindowManager","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-huxtable%2FCBHWindowManager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-huxtable%2FCBHWindowManager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-huxtable%2FCBHWindowManager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-huxtable%2FCBHWindowManager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chris-huxtable","download_url":"https://codeload.github.com/chris-huxtable/CBHWindowManager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247261581,"owners_count":20910107,"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":["objective-c","objective-c-library","window-manager"],"created_at":"2024-12-18T03:13:49.177Z","updated_at":"2025-04-04T22:44:59.190Z","avatar_url":"https://github.com/chris-huxtable.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CBHWindowManager\n\n[![release](https://img.shields.io/github/release/chris-huxtable/CBHWindowManager.svg)](https://github.com/chris-huxtable/CBHWindowManager/releases)\n[![pod](https://img.shields.io/cocoapods/v/CBHWindowManager.svg)](https://cocoapods.org/pods/CBHWindowManager)\n[![licence](https://img.shields.io/badge/licence-ISC-lightgrey.svg?cacheSeconds=2592000)](https://github.com/chris-huxtable/CBHWindowManager/blob/master/LICENSE)\n[![coverage](https://img.shields.io/badge/coverage-100%25-brightgreen.svg?cacheSeconds=2592000)](https://github.com/chris-huxtable/CBHWindowManager)\n\nAn easy-to-use singleton which manages `NSWindow` and `NSWindowController` objects.\n\n\n## Examples:\n\nAdding a controller so that once the window is closed both the window and controller are released.\n```objective-c\nSomeWindowController *controller = [[[SomeWindowController class] alloc] initWithWindowNibName:@\"SomeWindowNibName\"];\n[[CBHWindowManager sharedManager] manageController:controller];\n```\n\nAdding a controller with a key so that it may be found by name.\n```objective-c\n/// Create and adding the controller withe key.\nSomeWindowController *controller = [[[SomeWindowController class] alloc] initWithWindowNibName:@\"SomeWindowNibName\"];\n[[CBHWindowManager sharedManager] manageController:controller withKey:@\"SomeWindowKey\"];\n\n// ...\n\n/// Lookup the controller\nSomeWindowController *controller = [[CBHWindowManager sharedManager] controllerForKey:@\"SomeWindowKey\"];\n```\n\nFinding a controller with a key and if not creating and adding one.\n```objective-c\n/// Lookup the controller in the manager. If it's found, return early.\nSomeWindowController *controller = (SomeWindowController *)[[CBHWindowManager sharedManager] controllerForKey:@\"SomeWindowKey\"];\nif ( controller ) { return controller; }\n\n/// If the controller is not in the manager create it and add it to the manger.\ncontroller = [[[SomeWindowController class] alloc] initWithWindowNibName:@\"SomeWindowNibName\"];\n[[CBHWindowManager sharedManager] manageController:controller withKey:@\"SomeWindowKey\"];\nreturn controller;\n```\n\n## Licence\nCBHWindowManager is available under the [ISC license](https://github.com/chris-huxtable/CBHWindowManager/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchris-huxtable%2Fcbhwindowmanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchris-huxtable%2Fcbhwindowmanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchris-huxtable%2Fcbhwindowmanager/lists"}