{"id":2454,"url":"https://github.com/hryk224/PCLBlurEffectAlert","last_synced_at":"2025-08-03T00:30:50.084Z","repository":{"id":62449834,"uuid":"44104750","full_name":"hryk224/PCLBlurEffectAlert","owner":"hryk224","description":"Swift AlertController with UIVisualeffectview","archived":false,"fork":false,"pushed_at":"2018-08-09T20:03:20.000Z","size":1657,"stargazers_count":147,"open_issues_count":6,"forks_count":18,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-12-01T03:40:57.023Z","etag":null,"topics":["cocoapods","swift","swift-alertcontroller","uialertcontroller","uivisualeffectview"],"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/hryk224.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":"2015-10-12T12:03:48.000Z","updated_at":"2022-06-29T00:31:10.000Z","dependencies_parsed_at":"2022-11-29T13:20:56.757Z","dependency_job_id":null,"html_url":"https://github.com/hryk224/PCLBlurEffectAlert","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hryk224%2FPCLBlurEffectAlert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hryk224%2FPCLBlurEffectAlert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hryk224%2FPCLBlurEffectAlert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hryk224%2FPCLBlurEffectAlert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hryk224","download_url":"https://codeload.github.com/hryk224/PCLBlurEffectAlert/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228503230,"owners_count":17930545,"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":["cocoapods","swift","swift-alertcontroller","uialertcontroller","uivisualeffectview"],"created_at":"2024-01-05T20:16:14.155Z","updated_at":"2024-12-06T17:31:08.978Z","avatar_url":"https://github.com/hryk224.png","language":"Swift","funding_links":[],"categories":["UI","Libs"],"sub_categories":["Alert \u0026 Action Sheet","Other free courses","UI"],"readme":"# PCLBlurEffectAlert\n\nSwift AlertController, use UIVisualeffectview\n\n[![Cocoapods Compatible](http://img.shields.io/cocoapods/v/PCLBlurEffectAlert.svg?style=flat)](http://cocoadocs.org/docsets/PCLBlurEffectAlert)\n[![Swift 3.0](https://img.shields.io/badge/Swift-3.0-orange.svg?style=flat)](https://developer.apple.com/swift/)\n\n\u003cimg src=\"https://raw.githubusercontent.com/wiki/hryk224/PCLBlurEffectAlert/images/sample1.gif\" width=\"320\" \u003e \u003cimg src=\"https://raw.githubusercontent.com/wiki/hryk224/PCLBlurEffectAlert/images/sample2.gif\" width=\"320\" \u003e\n\n\u003cimg src=\"https://raw.githubusercontent.com/wiki/hryk224/PCLBlurEffectAlert/images/sample3.gif\" width=\"320\" \u003e \u003cimg src=\"https://raw.githubusercontent.com/wiki/hryk224/PCLBlurEffectAlert/images/sample4.gif\" width=\"320\" \u003e\n\n\u003cimg src=\"https://raw.githubusercontent.com/wiki/hryk224/PCLBlurEffectAlert/images/sample5.gif\" width=\"320\" \u003e\n\n## Requirements\n- iOS 8.0+\n- Swift 3.0+\n- ARC\n\n## Feature\n- [x] Change color\n- [x] Change effect\n- [x] Change font\n- [x] Use UITextField\n- [x] Use UIImageView\n\n## install\n\n#### Cocoapods\n\nAdding the following to your `Podfile` and running `pod install`:\n\n```Ruby\nuse_frameworks!\npod \"PCLBlurEffectAlert\"\n```\n\n### import\n\n```Swift\nimport PCLBlurEffectAlert\n```\n\n## Initialize\n\n#### UIBlurEffect\n\n```Swift\n// Default effect: UIBlurEffect(style: .extraLight)\nconvenience init(title: String?, message: String?, effect: UIBlurEffect, style: PCLBlurEffectAlert.ControllerStyle)\n```\n\n`style` =\u003e `alert`, `alertVertical`, `actionSheet`\n\nWhen `actions` count becomes more than 3, `alert` and `alertVertical` is the same as.\n\n## Usage\n\n#### Example\n\n```Swift\nlet alertController = PCLBlurEffectAlertController(title: \"How are you doing?\", \n                                                  message: \"Press a button!\",\n                                                  effect: UIBlurEffect(style: .lightdark)\n                                                  style: .alert)'\n// Customize if needed\nalertController.configure(titleColor: .white)\nalertController.configure(buttonFont: [.default: UIFont.systemFont(ofSize: 24),\n                                       .destructive: UIFont.boldSystemFont(ofSize: 20),\n                                       .cancel: UIFont.systemFont(ofSize: 14)])\n\n// Adds ImageView\nalertController.addImageView(with: \u003cimage files\u003e)\n\n// Adds TextField\nalertController.addTextField()\n\n// Adds actions\nlet action = PCLBlurEffectAlertAction(title: \"I’m fine.\", style: .default) { _ in }\nlet cancelAction = PCLBlurEffectAlertAction(title: \"Not so good.\", style: .cancel) { _ in }\nalertController.addAction(action)\nalertController.addAction(cancelAction)\n\n// Presented\nalertController.show() // or present(alertController, animated: true, completion: nil)\n```\n\n#### Sources\n\n```Swift\n// Adds Actions\nopen func addAction(_ action: PCLBlurEffectAlertAction)\n// Adds ImageView\nopen func addImageView(with image: UIImage, configurationHandler: ((UIImageView?) -\u003e Void)? = nil)\n// Adds TextFields\nopen func addTextField(with configurationHandler: ((UITextField?) -\u003e Void)? = nil)\n// Presented\nopen func show()\n```\n\n## Customize\n\n```Swift\n// Default ActionSheet: UIScreen.main.bounds.width - (margin * 2)\n// Default Alert: 320 - (margin * 2)\nfunc configure(alertViewWidth: CGFloat)\n\n// Default: 4\nfunc configure(cornerRadius: CGFloat)\n// Default: 1 / UIScreen.main.scale\nfunc configure(thin: CGFloat)\n// Default: 8\nfunc configure(margin: CGFloat)\n\n/// Color\n// Default: UIColor.black.withAlphaComponent(0.3)\nfunc configure(overlayBackgroundColor: UIColor)\n// Default: .clear\nfunc configure(backgroundColor: UIColor)\n\n/// Text\n// Default: .boldSystemFont(ofSize: 16)\n// Default: .black\nfunc configure(titleFont: UIFont, titleColor: UIColor)\n// Default: .systemFont(ofSize: 14)\n// Default: .black\nfunc configure(messageFont: UIFont, messageColor: UIColor)\n// Default: \n// .default: UIFont.systemFont(ofSize: 16),\n// .cancel: UIFont.systemFont(ofSize: 16),\n// .destructive: UIFont.systemFont(ofSize: 16)\nfunc configure(buttonFont: [PCLBlurEffectAlert.ActionStyle : UIFont])\n// Default: \n// .default: .black,\n// .cancel: .black,\n// .destructive: .red\nfunc configure(buttonTextColor: [PCLBlurEffectAlert.ActionStyle : UIColor])\n// Default: \n// .default: .gray,\n// .cancel: .gray,\n// .destructive: .gray\nfunc configure(buttonDisableTextColor: [PCLBlurEffectAlert.ActionStyle : UIColor])\n\n/// Button\n// Default: 44\nfunc configure(buttonHeight: CGFloat)\n// Default: .clear\nfunc configure(buttonBackgroundColor: UIColor)\n\n// Default: 32\nfunc configure(textFieldHeight: CGFloat)\n// Default: UIColor.white.withAlphaComponent(0.1)\nfunc configure(textFieldsViewBackgroundColor: UIColor)\n// Default: UIColor.black.withAlphaComponent(0.15)\nfunc configure(textFieldBorderColor: UIColor)\n\n```\n\n## More Examples\n\n```Swift\nlet alertController = PCLBlurEffectAlertController(title: \"How are you doing?\", \n                                                  message: \"Press a button!\",\n                                                  style: .alert)\nlet action1 = PCLBlurEffectAlertAction(title: \"I’m fine.\", style: .default) { _ in }\nlet action2 = PCLBlurEffectAlertAction(title: \"Not so good.\", style: .default) { _ in }\nalertController.addAction(action1)\nalertController.addAction(action2)\nalertController.show()\n```\n\n\u003cimg src=\"https://raw.githubusercontent.com/wiki/hryk224/PCLBlurEffectAlert/images/sample1.png\" width=\"320\" \u003e\n\n```Swift\nlet alertController = PCLBlurEffectAlertController(title: \"title title title title title title title\",\n                                                  message: \"message message message message message\",\n                                                  effect: UIBlurEffect(style: .light),\n                                                  style: .alert)\nalertController.addTextField { _ in }\nalertController.addTextField { _ in }\nalertController.configure(textFieldsViewBackgroundColor: UIColor.white.withAlphaComponent(0.1))\nalertController.configure(textFieldBorderColor: .black)\nalertController.configure(buttonDisableTextColor: [.default: .lightGray, .destructive: .lightGray])\nlet action1 = PCLBlurEffectAlertAction(title: \"Default\", style: .default) { _ in }\nlet action2 = PCLBlurEffectAlertAction(title: \"Destructive\", style: .destructive) { _ in }\nlet cancelAction = PCLBlurEffectAlertAction(title: \"Cancel\", style: .cancel) { _ in }\nalertController.addAction(action1)\nalertController.addAction(action2)\nalertController.addAction(cancelAction)\nalertController.show()\n```\n\n\u003cimg src=\"https://raw.githubusercontent.com/wiki/hryk224/PCLBlurEffectAlert/images/sample2.png\" width=\"320\" \u003e\n\n```Swift\nlet alertController = PCLBlurEffectAlertController(title: \"How are you doing?\", \n                                                  message: \"Press a button!\",\n                                                  effect: UIBlurEffect(style: .dark),\n                                                  style: .actionSheet)\nlet action1 = PCLBlurEffectAlertAction(title: \"I’m fine.\", style: .default) { _ in }\nlet action2 = PCLBlurEffectAlertAction(title: \"Not so good.\", style: .default) { _ in }\nalertController.addAction(action1)\nalertController.addAction(action2)\nalertController.show()\n```\n\n\u003cimg src=\"https://raw.githubusercontent.com/wiki/hryk224/PCLBlurEffectAlert/images/sample3.png\" width=\"320\" \u003e\n\n```Swift\nlet alertController = PCLBlurEffectAlertController(title: \"title title title title title title title\",\n                                                  message: \"message message message message message\",\n                                                  style: .actionSheet)\nalertController.addTextField()\nalertController.addTextField()\nalertController.configure(textFieldsViewBackgroundColor: UIColor.white.withAlphaComponent(0.1))\nalertController.configure(textFieldBorderColor: .black)\nalertController.configure(buttonDisableTextColor: [.default: .lightGray, .destructive: .lightGray])\nlet action1 = PCLBlurEffectAlertAction(title: \"Default\", style: .default) { _ in }\nlet action2 = PCLBlurEffectAlertAction(title: \"Destructive\", style: .destructive) { _ in }\nlet cancelAction = PCLBlurEffectAlertAction(title: \"Cancel\", style: .cancel) { _ in }\nalertController.addAction(action1)\nalertController.addAction(action2)\nalertController.addAction(cancelAction)\nalertController.show()\n```\n\n\u003cimg src=\"https://raw.githubusercontent.com/wiki/hryk224/PCLBlurEffectAlert/images/sample4.png\" width=\"320\" \u003e\n\n```Swift\nlet alertController = PCLBlurEffectAlertController(title: \"title title title title title title title\",\n                                                    message: \"message message message message message\",\n                                                    style: .alert)\nalertController.addImageView(with: UIImage(named: \"cat\")!)\nlet catAction = PCLBlurEffectAlertAction(title: \"Cat?\", style: .default) { _ in\n    print(\"You pressed Cat?\")\n}\nlet dogAction = PCLBlurEffectAlertAction(title: \"Dog?\", style: .default) { _ in\n    print(\"You pressed Dog?\")\n}\nalertController.addAction(catAction)\nalertController.addAction(dogAction)\nalertController.show()\n```\n\n\u003cimg src=\"https://raw.githubusercontent.com/wiki/hryk224/PCLBlurEffectAlert/images/sample5.png\" width=\"320\" \u003e\n\n## Photos from\n\n* by [pakutaso.com](https://www.pakutaso.com/)\n* by [FLATICON](http://www.flaticon.com/)\n\n## Acknowledgements\n\n* Inspired by [DOAlertController](https://github.com/okmr-d/DOAlertController) in [okmr-d](https://github.com/okmr-d).\n\n## License\n\nThis project is made available under the MIT license. See LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhryk224%2FPCLBlurEffectAlert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhryk224%2FPCLBlurEffectAlert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhryk224%2FPCLBlurEffectAlert/lists"}