{"id":19053081,"url":"https://github.com/louisdh/keycommandalertcontroller","last_synced_at":"2025-10-08T04:46:04.696Z","repository":{"id":87067047,"uuid":"85436344","full_name":"louisdh/KeyCommandAlertController","owner":"louisdh","description":"UIAlertController wrapper to add keyboard shortcuts easily","archived":false,"fork":false,"pushed_at":"2017-03-19T19:20:59.000Z","size":779,"stargazers_count":19,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-18T10:24:02.883Z","etag":null,"topics":["ios","ipad","keyboard","ui","uialertcontroller","uikit","ux"],"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/louisdh.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":"2017-03-18T22:34:33.000Z","updated_at":"2023-06-15T20:32:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"51522feb-6281-4a18-aa81-57890111016f","html_url":"https://github.com/louisdh/KeyCommandAlertController","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louisdh%2FKeyCommandAlertController","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louisdh%2FKeyCommandAlertController/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louisdh%2FKeyCommandAlertController/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louisdh%2FKeyCommandAlertController/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/louisdh","download_url":"https://codeload.github.com/louisdh/KeyCommandAlertController/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250551420,"owners_count":21449158,"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","ipad","keyboard","ui","uialertcontroller","uikit","ux"],"created_at":"2024-11-08T23:28:58.898Z","updated_at":"2025-10-08T04:45:59.664Z","avatar_url":"https://github.com/louisdh.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KeyCommandAlertController\nThis project contains wrappers for ```UIAlertController``` and ```UIAlertAction``` to easily add keyboard shortcuts (known as ```key command```).\n\n![](readme-resources/example.gif)\n\nThe following example shows how the action sheet shown above is created:\n\n```swift\nlet alert = KeyCommandAlertController(title: \"Change background color\", message: nil, preferredStyle: .actionSheet)\n\nalert.popoverPresentationController?.barButtonItem = sender\n\nlet redShortcut = KeyCommandShortcut(input: \"B\", modifierFlags: .command)\nlet redAction = KeyCommandAlertAction(title: \"Blue\", style: .default, keyShortcut: redShortcut) { (action) in\n\tself.makeBlue()\n}\n\nlet greenShortcut = KeyCommandShortcut(input: \"R\", modifierFlags: .command)\nlet greenAction = KeyCommandAlertAction(title: \"Red\", style: .default, keyShortcut: greenShortcut) { (action) in\n\tself.makeRed()\n}\n\nlet cancelAction = KeyCommandAlertAction(title: \"Cancel\", style: .cancel)\n\nalert.addAction(redAction)\nalert.addAction(greenAction)\nalert.addAction(cancelAction)\n\npresent(alert, animated: true, completion: nil)\n```\n\n\n### TODO\n- [ ] Only show shortcuts in alert actions when external keyboard is connected","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flouisdh%2Fkeycommandalertcontroller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flouisdh%2Fkeycommandalertcontroller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flouisdh%2Fkeycommandalertcontroller/lists"}