{"id":15030428,"url":"https://github.com/sberrevoets/sdcalertview","last_synced_at":"2025-05-13T23:04:56.397Z","repository":{"id":12048231,"uuid":"14634111","full_name":"sberrevoets/SDCAlertView","owner":"sberrevoets","description":"The little alert that could","archived":false,"fork":false,"pushed_at":"2025-01-22T07:14:46.000Z","size":5297,"stargazers_count":1854,"open_issues_count":17,"forks_count":303,"subscribers_count":38,"default_branch":"master","last_synced_at":"2025-05-08T05:36:10.721Z","etag":null,"topics":["actionsheet","alert"],"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/sberrevoets.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2013-11-23T01:31:42.000Z","updated_at":"2025-04-29T15:29:14.000Z","dependencies_parsed_at":"2024-06-18T12:14:48.374Z","dependency_job_id":"81d249f4-7c98-4df2-9dcf-1ee91b2382ba","html_url":"https://github.com/sberrevoets/SDCAlertView","commit_stats":{"total_commits":632,"total_committers":56,"mean_commits":"11.285714285714286","dds":0.4177215189873418,"last_synced_commit":"8d821711afc967b44c74bbd57ba2b2bfeaefb118"},"previous_names":[],"tags_count":62,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sberrevoets%2FSDCAlertView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sberrevoets%2FSDCAlertView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sberrevoets%2FSDCAlertView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sberrevoets%2FSDCAlertView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sberrevoets","download_url":"https://codeload.github.com/sberrevoets/SDCAlertView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254040586,"owners_count":22004572,"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":["actionsheet","alert"],"created_at":"2024-09-24T20:13:18.447Z","updated_at":"2025-05-13T23:04:51.377Z","avatar_url":"https://github.com/sberrevoets.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SDCAlertView\n\n`SDCAlertView` started out as an alert that looked identical to `UIAlertView`, but had support for a custom content view. With the introduction of `UIAlertController` in iOS 8, the project was updated to the more modern API that `UIAlertController` brought.\n\n## Features\n\n- [x] Most `UIAlertController` functionality\n- [x] Custom content views\n- [x] Preventing controllers from dismissing when the user taps a button\n- [x] Easy presentation/dismissal\n- [x] Attributed title label, message label, and buttons\n- [x] Appearance customization\n- [x] Usable from Swift and Objective-C\n- [x] Understandable button placement\n- [x] UI tests\n- [x] Custom alert behavior\n- [x] CocoaPods/Carthage/Swift Package Manager support\n- [ ] Easy queueing of alerts\n\n# Requirements\n\n - Swift 5.0\n - iOS 9 or higher\n\n# Installation\n\n## CocoaPods\nTo install SDCAlertView using CocoaPods, integrate it in your existing Podfile, or create a new Podfile:\n\n```ruby\nplatform :ios, '9.0'\nuse_frameworks!\n\ntarget 'MyApp' do\n  pod 'SDCAlertView'\nend\n```\n\nThen run `pod install`.\n\n## Carthage\nTo install with Carthage, add the following line to your `Cartfile`:\n\n```ruby\ngithub \"sberrevoets/SDCAlertView\"\n```\n\nRun `carthage update` and drag `SDCAlertView.framework` in the `Build` folder into your project.\n\n## Swift Package Manager\n\nTo install with Swift Package Manager, add this package to your project’s 'Swift Packages' section. Or add the following line to your `Package.swift`:\n\n```swift\n .package(url: \"https://github.com/sberrevoets/SDCAlertView.git\", from: \"12.0.5\")\n```\n\n# Alerts vs. Action Sheets\n\n`SDCAlertController` supports the presentation of action sheets, but there are some limitations and things to keep in mind when using action sheets:\n\n- It does not properly adapt on iPad. This is because iOS doesn't support `UIModalPresentationStyle.Custom` for adaptive presentations (such as when presenting an action sheet from a bar button item).\n- The new `AlertBehaviors` is, due to limitations in the Swift/Objective-C interop, not available when using `SDCAlertController` from Swift. This affects `AlertControllerStyle.Alert` as well.\n- When adding subviews to the custom content view, that view will replace the title and message labels.\n\n# Usage\n`SDCAlertView` is written in Swift, but can be used in both Swift and Objective-C. Corresponding types in Objective-C have the same name they do in Swift, but with an `SDC` prefix.\n\n## Basic\n\n```swift\nlet alert = AlertController(title: \"Title\", message: \"This is a message\", preferredStyle: .alert)\nalert.addAction(AlertAction(title: \"Cancel\", style: .normal))\nalert.addAction(AlertAction(title: \"OK\", style: .preferred))\nalert.present()\n\n// or use the convenience methods:\n\nAlertController.alert(withTitle: \"Title\", message: \"This is a message\", actionTitle: \"OK\")\nAlertController.sheet(withTitle: \"Action sheet title\", \"Action sheet message\", actions: [\"OK\", \"Cancel\"])\n```\n\n## Custom Content Views\n\n```swift\nlet spinner = UIActivityIndicatorView(activityIndicatorStyle: .gray)\nspinner.translatesAutoresizingMaskIntoConstraints = false\nspinner.startAnimating()\n\nlet alert = AlertController(title: \"Title\", message: \"Please wait...\")\nalert.contentView.addSubview(spinner)\n\nspinner.centerXAnchor.constraint(equalTo: alert.contentView.centerXAnchor).isActive = true\nspinner.topAnchor.constraint(equalTo: alert.contentView.topAnchor).isActive = true\nspinner.bottomAnchor.constraint(equalTo: alert.contentView.bottomAnchor).isActive = true\n\nalert.present()\n```\n\n## Dismissal Prevention\n\n```swift\nlet alert = AlertController(title: \"Title\", message: \"This is a message\")\nalert.addAction(AlertAction(title: \"Dismiss\", style: .preferred))\nalert.addAction(AlertAction(title: \"Don't dismiss\", style: .normal))\nalert.shouldDismissHandler = { $0.title == \"Dismiss\" }\nalert.present()\n```\n\n## Styling and Appearance\n\n`SDCAlertController` is a normal view controller, so applying a `tintColor` to its `view` will color the buttons and any subviews you add to the `contentView`.\n\nIf you are looking for more customizations, create a subclass of `AlertVisualStyle` and use `visualStyle` on the `AlertController` instance. You can also create an instance of `AlertVisualStyle` and overwrite the attributes you need (this is mainly intended to be used from Objective-C). Note that after an alert has been presented, changing any of these settings is ignored.\n\n# License\n\nSDCAlertView is distributed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsberrevoets%2Fsdcalertview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsberrevoets%2Fsdcalertview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsberrevoets%2Fsdcalertview/lists"}