{"id":2441,"url":"https://github.com/candostdagdeviren/CDAlertView","last_synced_at":"2025-08-06T15:30:53.593Z","repository":{"id":55672509,"uuid":"72364882","full_name":"candostdagdeviren/CDAlertView","owner":"candostdagdeviren","description":"Highly customizable alertview and alert/notification/success/error/alarm popup written in Swift","archived":false,"fork":false,"pushed_at":"2020-12-13T21:17:01.000Z","size":1354,"stargazers_count":1145,"open_issues_count":6,"forks_count":86,"subscribers_count":28,"default_branch":"master","last_synced_at":"2024-12-01T19:37:05.369Z","etag":null,"topics":["alert","alert-messages","alerts","alertview","carthage","cocoapods","popup","popup-window","swift5","warning"],"latest_commit_sha":null,"homepage":"https://candostdagdeviren.github.io/CDAlertView/","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/candostdagdeviren.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-30T17:40:59.000Z","updated_at":"2024-11-12T16:37:38.000Z","dependencies_parsed_at":"2022-08-15T06:10:21.776Z","dependency_job_id":null,"html_url":"https://github.com/candostdagdeviren/CDAlertView","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/candostdagdeviren%2FCDAlertView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/candostdagdeviren%2FCDAlertView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/candostdagdeviren%2FCDAlertView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/candostdagdeviren%2FCDAlertView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/candostdagdeviren","download_url":"https://codeload.github.com/candostdagdeviren/CDAlertView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228915470,"owners_count":17991410,"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":["alert","alert-messages","alerts","alertview","carthage","cocoapods","popup","popup-window","swift5","warning"],"created_at":"2024-01-05T20:16:13.860Z","updated_at":"2024-12-09T15:30:54.245Z","avatar_url":"https://github.com/candostdagdeviren.png","language":"Swift","funding_links":[],"categories":["UI","Libs","Notification","Swift","UI [🔝](#readme)"],"sub_categories":["Alert \u0026 Action Sheet","UI","Other free courses"],"readme":"![CDAlertView: Highly customizable alert popup](https://cloud.githubusercontent.com/assets/1971963/20237496/34d3081c-a8d4-11e6-8907-80b4c248dce0.png)\n\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![Cocoapod](http://img.shields.io/cocoapods/v/CDAlertView.svg?style=flat)](http://cocoadocs.org/docsets/CDAlertView/)\n[![CI Status](http://img.shields.io/travis/candostdagdeviren/CDAlertView.svg?style=flat)](https://travis-ci.org/candostdagdeviren/CDAlertView/)\n[![Language](https://img.shields.io/badge/swift-5-orange.svg)](https://developer.apple.com/swift)\n[![Platform](http://img.shields.io/badge/platform-ios-lightgrey.svg?style=flat)](https://developer.apple.com/resources/)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://raw.githubusercontent.com/candostdagdeviren/CDAlertView/master/LICENSE)\n\nCDAlertView is highly customizable alert popup written in Swift. Usage is similar to `UIAlertController`.\n\n### Screenshots\n\n![CDAlertView Types](https://cloud.githubusercontent.com/assets/1971963/20238308/4bc1516e-a8e8-11e6-8e8b-c1a088f5daa0.png)\n\n### Animations\n\n![1](https://github.com/candostdagdeviren/CDAlertView/blob/master/Screenshots/1.gif)\n![2](https://github.com/candostdagdeviren/CDAlertView/blob/master/Screenshots/2.gif)\n![3](https://github.com/candostdagdeviren/CDAlertView/blob/master/Screenshots/3.gif)\n\n## Usage\n\nBasic usage without any buttons:\n\n```swift\nCDAlertView(title: \"Awesome Title\", message: \"Well explained message!\", type: .notification).show()\n```\n**NOTE:** You can use it without buttons. Touch outside of the popup or move it will disappear it if there is no action button. If there is an action button, only pressing button will disappear it.\n\nTo add new buttons:\n```swift\nlet alert = CDAlertView(title: \"Awesome Title\", message: \"Are you in?!\", type: .notification)\nlet doneAction = CDAlertViewAction(title: \"Sure! 💪\")\nalert.add(action: doneAction)\nlet nevermindAction = CDAlertViewAction(title: \"Nevermind 😑\")\nalert.add(action: nevermindAction)\nalert.show()\n```\n\nTo enable text field in popup:\n```swift\nalert.isTextFieldHidden = false\n```\n\nCustom view is also supported. If you want to use custom view, you are responsible for the height of custom view. Custom view is used in `UIStackView`.\n```swift\nlet myCustomView = UIVIew(frame: myFrame)\n// Don't forget to handle height of `myCustomView`\nalert.customView = myCustomView\n```\n\nCDAlertView types:\n\n```swift\npublic enum CDAlertViewType {\n    case error, warning, success, notification, alarm, noImage, custom(image:UIImage)\n}\n```\n\n## Initialization\n\n### Advanced Alert Initialization\nTo use it with your custom icon, initialize without type (or with .empty) and set your icon and background color:\n\n```swift\nlet alert = CDAlertView(title: \"Awesome Title\", message: \"Well explained message!\", type: .custom(image: UIImage(named:\"YourAwesomeImage\")))\nalert.circleFillColor = UIColor.yourAmazingColor\n```\n\n### Hide Alert with your animation\n```swift\nlet alert = CDAlertView(title: \"Awesome Title\", message: \"Well explained message!\", type: .success)\nalert.hideAnimations = { (center, transform, alpha) in\n    transform = CGAffineTransform(scaleX: 3, y: 3)\n    alpha = 0\n}\nalert.hideAnimationDuration = 0.88\nalert.show()\n```\n\n### Hide Alert with timer\n```swift\nlet alert = CDAlertView(title: \"Awesome Title\", message: \"Well explained message!\", type: .success)\nalert.autoHideTime = 4.5 // This will hide alert box after 4.5 seconds\n```\n\n### List of Available CDAlertView Options\n\n`titleTextColor: UIColor` -\u003e Sets title's text color\n\n`messageTextColor: UIColor` -\u003e Sets message's text color\n\n`titleFont: UIFont` -\u003e Sets title's font\n\n`messageFont: UIFont` -\u003e Sets message's font\n\n`isHeaderIconFilled: Bool` -\u003e Chooses filled icons instead of outline ones. Default is `false`.\n\n`alertBackgroundColor: UIColor` -\u003e Sets popup's background color.\n\n`popupWidth: CGFloat` -\u003e Width of the popup view\n\n`hasRoundedCorners: Bool` -\u003e Apply rounded corners to alert view. Default is `true`.\n\n`hasShadow: Bool` -\u003e Apply shadows around the popup. Defualt is `true`.\n\n`circleFillColor: UIColor` -\u003e Sets background color of header icon. (Color of circle area)\n\n`isActionButtonsVertical: Bool` -\u003e Alignes action buttons vertical. Default is `false`. Maximum number of horizontal buttons is 3.\n\n`canHideWhenTapBack` -\u003e Hide self when tapped backgroundView. Default is `false`. \n\n`hideAnimationDuration: TimeInterval` -\u003e Sets the animation duration of hide animation\n\n`hideAnimations: CDAlertAnimationBlock` -\u003e Sets the hiding animations depending on the `center`, `transform` and `alpha` values. You can create your animations by changing these values for alert popup.\n\nIf you enabled text field with setting `isTextFieldHidden` property to `false`, following properties will be available also:\n\n`textFieldFont: UIFont` -\u003e Font of textField's text\n\n`textFieldIsSecureTextEntry: Bool` -\u003e Sets the `isSecureTextEntry` property of `UITextField`\n\n`textFieldReturnKeyType: UIReturnKeyType` -\u003e Sets the `returnKeyType` property of `UITextField`\n\n`textFieldTextAlignment: NSTextAlignment` -\u003e Sets the `textAlignment` property of `UITextField`. Default is `.left`.\n\n`textFieldPlaceholderText: String?` -\u003e Sets the placeholder text for `UITextField`.\n\n`textFieldAutocapitalizationType: UITextAutocapitalizationType` -\u003e Sets the `autocapitalizationType` property of `UITextField`. Default is `.none`.\n\n`textFieldBackgroundColor: UIColor` -\u003e Sets `UITextField`'s background color.\n\n`textFieldTintColor: UIColor` -\u003e Sets `UITextField`'s tint color.\n\n`textFieldText: String?` -\u003e Sets \u0026 gets `UITextField`'s text.\n\n`textFieldHeight: CGFloat` -\u003e Sets the height of `UITextField`.\n\n`textFieldDelegate: UITextViewDelegate?` -\u003e Sets the delegate of `UITextField`. Default delegate is `CDAlertView`. If you overwrite this, you're responsible for resigning the `UITextField`.\n\n`autoHideTime: TimeInterval?` -\u003e Sets the time interval for dismiss time. Default is `nil`.\n\n### Advanced action initialization:\n\n`font`, `textColor`, `backgroundColor`, `handler` are all optional and has default parameter values. You can initilize with them or set them after initialization.\n\n```swift\nlet action = CDAlertViewAction(title: \"Action Title\", font: UIFont.yourCustomFont, textColor: UIColor.yourTextColor, backgroundColor: UIColor.yourBackgroundColor, handler: { action in })\nalertView.addAction(action)\n```\n\n**NOTE:** Aligning buttons vertical and horizontal is possible. But using more than 3 buttons in horizontal placement is not possible.\n\n### List of CDAlertViewAction Options\n\n`buttonTitle: String` -\u003e Set's the action button title\n\n`buttonTextColor: UIColor` -\u003e Sets the action button title color. Default value is RGB(27,169,225).\n\n`buttonFont: UIFont` -\u003e Sets the action button title font. Default value is `UIFont.systemFont(ofSize: 17)`.\n\n`buttonBackgroundColor: UIColor` -\u003e Sets the background color of action button. If not set, it uses `alertBackgroundColor` of CDAlertView.\n\n### List of available methods\n\n`textFieldBecomeFirstResponder()` -\u003e Calls the `becomeFirstResponder()` method of `textField` if  `alert.isTextFieldHidden` set to `true`. Otherwise, does nothing.\n\n`textFieldResignFirstResponder()` -\u003e Calls the `resignFirstResponder()` method of `textField` if  `alert.isTextFieldHidden` set to `true`. Otherwise, does nothing.\n\n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n## Installation\n\n**This library supports Swift 5. Use `0.9.1` for Swift 4.2. Use `0.6.1` for Swift 3.1.**\n\n### Using [CocoaPods](http://cocoapods.org)\n\nCDAlertView is available through CocoaPods. To install it, simply add the following line to your `Podfile`:\n\n```ruby\npod \"CDAlertView\"\n```\n\n### Using [Carthage](https://github.com/Carthage/Carthage)\n\nCDAlertView is available through Carthage. To install it, simply add the following line to your `Cartfile`:\n\n```\ngithub \"candostdagdeviren/CDAlertView\"\n```\n\n## Requirements\n\n* Xcode 9\n* Swift 4\n* iOS 9.0+\n\n### Icons\n\nThanks to [Icons8](https://icons8.com/) for beautiful icons.\n\n## License\n\nCDAlertView is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcandostdagdeviren%2FCDAlertView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcandostdagdeviren%2FCDAlertView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcandostdagdeviren%2FCDAlertView/lists"}