{"id":17090843,"url":"https://github.com/phimage/alertcontroller","last_synced_at":"2025-08-25T22:14:26.879Z","repository":{"id":62448600,"uuid":"72219826","full_name":"phimage/AlertController","owner":"phimage","description":"An NSViewController to display an alert message to the user. This class replaces the NSAlert class.","archived":false,"fork":false,"pushed_at":"2025-06-01T08:42:16.000Z","size":4391,"stargazers_count":8,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-13T03:07:56.651Z","etag":null,"topics":[],"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/phimage.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":"2016-10-28T15:34:24.000Z","updated_at":"2025-06-01T08:42:19.000Z","dependencies_parsed_at":"2022-11-01T23:17:56.483Z","dependency_job_id":null,"html_url":"https://github.com/phimage/AlertController","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/phimage/AlertController","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phimage%2FAlertController","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phimage%2FAlertController/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phimage%2FAlertController/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phimage%2FAlertController/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phimage","download_url":"https://codeload.github.com/phimage/AlertController/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phimage%2FAlertController/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270781393,"owners_count":24643820,"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","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-10-14T13:56:53.111Z","updated_at":"2025-08-16T23:06:17.279Z","avatar_url":"https://github.com/phimage.png","language":"Swift","readme":"# AlertController\n\n[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat\n            )](http://mit-license.org)\n[![Platform](http://img.shields.io/badge/platform-macos-lightgrey.svg?style=flat\n             )](https://developer.apple.com/resources/)\n[![Language](http://img.shields.io/badge/language-swift-orange.svg?style=flat\n             )](https://developer.apple.com/swift)\n[![Issues](https://img.shields.io/github/issues/phimage/AlertController.svg?style=flat\n           )](https://github.com/phimage/AlertController/issues)\n[![Cocoapod](http://img.shields.io/cocoapods/v/NSAlertController.svg?style=flat)](http://cocoadocs.org/docsets/NSAlertController/)\n\nA `NSViewController` to display an alert message to the user.\nThis class replaces the `NSAlert` class and is inspired from `UIAlertController`.\n\nAfter configuring the alert controller with the actions and style you want, present it using `presentViewControllerAsSheet`.\n\n```swift\nlet controller = AlertController(title: \"Alert title\", message: \"An alert message\", preferredStyle: .warning)\nparentVC.presentViewControllerAsSheet(controller)\n\n```\n\u003cimg align=\"center\" src=\"Demo/DemoInfo.png\"\u003e\n## Usage\n\n### Add a simple dismiss action\n```swift\ncontroller.add(action: AlertAction.dismiss(for: controller, title: \"Ok\"))\n```\n### Add custom action\n```swift\ncontroller.add(action: AlertAction(title: \"Report...\") { action in\n    NSWorkspace.shared().open(URL(string: \"https://github.com/phimage/AlertController/issues\")!)\n})\n```\n### Choose a style\n```swift\ncontroller.addAction(title: \"\", style: .helpButton) { action in\n    // show error help\n}\n```\n\n### Customize buttons bar\n```swift\ncontroller.buttonsBar.color = NSColor.red\ncontroller.buttonsBar.buttonSpace = 8\n```\n\u003cimg align=\"center\" src=\"Demo/DemoAlert.png\"\u003e\n\n## Todo\n- More customization\n  - align buttons left or right\n  - automatic helpButton on left\n- Maybe input text fields\n\n## Installation\n\n### Using CocoaPods ##\n[CocoaPods](https://cocoapods.org/) is a centralized dependency manager for\nObjective-C and Swift. Go [here](https://guides.cocoapods.org/using/index.html)\nto learn more.\n\n1. Add the project to your [Podfile](https://guides.cocoapods.org/using/the-podfile.html).\n\n    ```ruby\n    use_frameworks!\n\n    pod 'NSAlertController'\n    ```\n\n2. Run `pod install` and open the `.xcworkspace` file to launch Xcode.\n\n### Using Carthage ##\n```ruby\ngithub 'phimage/AlertController'\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphimage%2Falertcontroller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphimage%2Falertcontroller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphimage%2Falertcontroller/lists"}