{"id":2407,"url":"https://github.com/vikmeup/SCLAlertView-Swift","last_synced_at":"2025-08-06T16:30:59.287Z","repository":{"id":47046326,"uuid":"20557685","full_name":"vikmeup/SCLAlertView-Swift","owner":"vikmeup","description":"Beautiful animated Alert View. Written in Swift","archived":false,"fork":false,"pushed_at":"2024-01-05T10:18:13.000Z","size":3983,"stargazers_count":5328,"open_issues_count":149,"forks_count":766,"subscribers_count":137,"default_branch":"master","last_synced_at":"2024-12-03T12:03:33.243Z","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/vikmeup.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}},"created_at":"2014-06-06T09:06:43.000Z","updated_at":"2024-11-24T20:13:43.000Z","dependencies_parsed_at":"2022-08-12T13:11:30.084Z","dependency_job_id":"878507ef-9bd8-492e-9b38-c7d45aef4f60","html_url":"https://github.com/vikmeup/SCLAlertView-Swift","commit_stats":{"total_commits":341,"total_committers":104,"mean_commits":"3.2788461538461537","dds":0.7302052785923754,"last_synced_commit":"f08ec93c299a221210e59462c84c79410050e5b7"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vikmeup%2FSCLAlertView-Swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vikmeup%2FSCLAlertView-Swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vikmeup%2FSCLAlertView-Swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vikmeup%2FSCLAlertView-Swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vikmeup","download_url":"https://codeload.github.com/vikmeup/SCLAlertView-Swift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228923683,"owners_count":17992566,"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":[],"created_at":"2024-01-05T20:16:12.986Z","updated_at":"2024-12-09T16:30:59.494Z","avatar_url":"https://github.com/vikmeup.png","language":"Swift","readme":"SCLAlertView\n===========\n\n[![Version](https://img.shields.io/cocoapods/v/SCLAlertView.svg?style=flat)](http://cocoadocs.org/docsets/SCLAlertView/)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n\nAnimated Alert View written in Swift, which can be used as a `UIAlertView` or `UIAlertController` replacement with nice customization features. \n\n![BackgroundImage](https://raw.githubusercontent.com/vikmeup/SCPopUpView/master/successScreenshot.png)_\n![BackgroundImage](https://raw.githubusercontent.com/vikmeup/SCPopUpView/master/editScreenshot.png)\n\nEasy to use\n----\n\n### Get Started\n\n```swift\n// Get started\nSCLAlertView().showInfo(\"Important info\", subTitle: \"You are great\")\n```\n\n### Updating the alert view\n\n```swift\nlet alertViewResponder: SCLAlertViewResponder = SCLAlertView().showSuccess(\"Hello World\", subTitle: \"This is a more descriptive text.\")\n\n// Upon displaying, change/close view\nalertViewResponder.setTitle(\"New Title\") // Rename title\nalertViewResponder.setSubTitle(\"New description\") // Rename subtitle\nalertViewResponder.close() // Close view\n```\n\n### Alternative alert types\n\n```\nSCLAlertView().showError(\"Hello Error\", subTitle: \"This is a more descriptive error text.\") // Error\nSCLAlertView().showNotice(\"Hello Notice\", subTitle: \"This is a more descriptive notice text.\") // Notice\nSCLAlertView().showWarning(\"Hello Warning\", subTitle: \"This is a more descriptive warning text.\") // Warning\nSCLAlertView().showInfo(\"Hello Info\", subTitle: \"This is a more descriptive info text.\") // Info\nSCLAlertView().showEdit(\"Hello Edit\", subTitle: \"This is a more descriptive info text.\") // Edit\n```\n\n### Raw call to showTitle()\n\n```swift\nSCLAlertView().showTitle(\n    \"Congratulations\", // Title of view\n    subTitle: \"Operation successfully completed.\", // String of view\n    duration: 2.0, // Duration to show before closing automatically, default: 0.0\n    completeText: \"Done\", // Optional button value, default: \"\"\n    style: .success, // Styles - see below.\n    colorStyle: UIColorFromRGB(0xA429FF),\n    colorTextButton: .white\n)\n```\n\n### Controls\n\n#### Custom Appearance\n\n```swift\n// SCLAlertView.SCLAppearanc has more than 15 different properties to customize. See below.\n\nlet appearance = SCLAlertView.SCLAppearance(\n    kTitleFont: UIFont(name: \"HelveticaNeue\", size: 20)!,\n    kTextFont: UIFont(name: \"HelveticaNeue\", size: 14)!,\n    kButtonFont: UIFont(name: \"HelveticaNeue-Bold\", size: 14)!,\n    showCloseButton: false\n)\n\nlet alert = SCLAlertView(appearance: appearance)\n```\n\n#### Add buttons\n\n```swift\nlet alertView = SCLAlertView()\nalertView.addButton(\"First Button\", target:self, selector:Selector(\"firstButton\"))\nalertView.addButton(\"Second Button\") {\n    print(\"Second button tapped\")\n}\nalertView.showSuccess(\"Button View\", subTitle: \"This alert view has buttons\")\n```\n\n#### Hide default close button\n\n```swift\nlet appearance = SCLAlertView.SCLAppearance(\n    showCloseButton: false\n)\nlet alertView = SCLAlertView(appearance: appearance)\nalertView.showSuccess(\"No button\", subTitle: \"You will have hard times trying to close me\")\n```\n\n#### Hide default close button \u0026 a duration to close the alert\n\n```swift\nlet appearance = SCLAlertView.SCLAppearance(\n    showCloseButton: false\n)\nlet alertView = SCLAlertView(appearance: appearance)\nalertView.showWarning(\"No button\", subTitle: \"Just wait for 3 seconds and I will disappear\", duration: 3)\n```\n\n\n#### Hide alert icon\n\n```swift\nlet appearance = SCLAlertView.SCLAppearance(\n    showCircularIcon: false\n)\nlet alertView = SCLAlertView(appearance: appearance)\nalertView.showSuccess(\"No icon\", subTitle: \"This is a clean alert without Icon!\")\n```\n\n#### Use a custom icon\n\n```swift\nlet appearance = SCLAlertView.SCLAppearance(\n    showCircularIcon: true\n)\nlet alertView = SCLAlertView(appearance: appearance)\nlet alertViewIcon = UIImage(named: \"IconImage\") //Replace the IconImage text with the image name\nalertView.showInfo(\"Custom icon\", subTitle: \"This is a nice alert with a custom icon you choose\", circleIconImage: alertViewIcon)\n```\n\n\n#### Add Text fields\n\n```swift\n// Add a text field\nlet alert = SCLAlertView()\nlet txt = alert.addTextField(\"Enter your name\")\nalert.addButton(\"Show Name\") {\n    print(\"Text value: \\(txt.text)\")\n}\nalert.showEdit(\"Edit View\", subTitle: \"This alert view shows a text box\")\n\n```\n\n#### Use a custom subview instead of a subtitle\n```swift\n// Example of using the view to add two text fields to the alert\n// Create custom Appearance Configuration\nlet appearance = SCLAlertView.SCLAppearance(\n    kTitleFont: UIFont(name: \"HelveticaNeue\", size: 20)!,\n    kTextFont: UIFont(name: \"HelveticaNeue\", size: 14)!,\n    kButtonFont: UIFont(name: \"HelveticaNeue-Bold\", size: 14)!,\n    showCloseButton: false,\n    dynamicAnimatorActive: true\n)\n\n// Initialize SCLAlertView using custom Appearance\nlet alert = SCLAlertView(appearance: appearance)\n\n// Creat the subview\nlet subview = UIView(frame: CGRect(x: 0,y: 0,width: 216,height: 70))\nlet x = (subview.frame.width - 180) / 2\n\n// Add textfield 1\nlet textfield1 = UITextField(frame: CGRect(x: x,y: 10,width: 180,height: 25))\ntextfield1.layer.borderColor = UIColor.green.cgColor\ntextfield1.layer.borderWidth = 1.5\ntextfield1.layer.cornerRadius = 5\ntextfield1.placeholder = \"Username\"\ntextfield1.textAlignment = NSTextAlignment.center\nsubview.addSubview(textfield1)\n\n// Add textfield 2\nlet textfield2 = UITextField(frame: CGRect(x: x,y: textfield1.frame.maxY + 10,width: 180,height: 25))\ntextfield2.isSecureTextEntry = true\ntextfield2.layer.borderColor = UIColor.blue.cgColor\ntextfield2.layer.borderWidth = 1.5\ntextfield2.layer.cornerRadius = 5\ntextfield1.layer.borderColor = UIColor.blue.cgColor\ntextfield2.placeholder = \"Password\"\ntextfield2.textAlignment = NSTextAlignment.center\nsubview.addSubview(textfield2)\n\n// Add the subview to the alert's UI property\nalert.customSubview = subview\n_ = alert.addButton(\"Login\") {\n    print(\"Logged in\")\n}\n\n// Add Button with visible timeout and custom Colors\nlet showTimeout = SCLButton.ShowTimeoutConfiguration(prefix: \"(\", suffix: \" s)\")\n_ = alert.addButton(\"Timeout Button\", backgroundColor: UIColor.brown, textColor: UIColor.yellow, showTimeout: showTimeout) {\n    print(\"Timeout Button tapped\")\n}\n\nlet timeoutValue: TimeInterval = 10.0\nlet timeoutAction: SCLAlertView.SCLTimeoutConfiguration.ActionType = {\n    print(\"Timeout occurred\")\n}\n\n_ = alert.showInfo(\"Login\", subTitle: \"\", timeout: SCLAlertView.SCLTimeoutConfiguration(timeoutValue: timeoutValue, timeoutAction: timeoutAction))\n```\n\n\n#### List of properties to customize\n\n```swift\n// Button \nkButtonFont: UIFont                     \nbuttonCornerRadius : CGFloat            \nshowCloseButton: Bool                   \nkButtonHeight: CGFloat                  \n\n// Circle Image\nshowCircularIcon: Bool\nkCircleTopPosition: CGFloat\nkCircleBackgroundTopPosition: CGFloat\nkCircleHeight: CGFloat\nkCircleIconHeight: CGFloat\n\n// Text\nkTitleFont: UIFont\nkTitleTop:CGFloat\nkTitleHeight:CGFloat\nkTextFont: UIFont\nkTextHeight: CGFloat\nkTextFieldHeight: CGFloat\nkTextViewdHeight: CGFloat\n\n// View \nkDefaultShadowOpacity: CGFloat          \nkWindowWidth: CGFloat\nkWindowHeight: CGFloat\nshouldAutoDismiss: Bool // Set this false to 'Disable' Auto hideView when SCLButton is tapped\nfieldCornerRadius : CGFloat\ncontentViewCornerRadius : CGFloat\ndisableTapGesture: Bool // set this to true if adding tableview to subView\n```\n\n\n### Alert View Styles\n\n```swift\nenum SCLAlertViewStyle: Int {\n    case success, error, notice, warning, info, edit, wait, question\n}\n```\n\n\n### Alert show animation Styles\n\n```swift\n// Animation Styles\npublic enum SCLAnimationStyle {\n    case noAnimation, topToBottom, bottomToTop, leftToRight, rightToLeft\n}\n```\n\n\nInstallation\n---\n\nSCLAlertView is available through \n\n### [CocoaPods](http://cocoapods.org)\n\nTo install add the following line to your Podfile:\n\n    pod 'SCLAlertView'\n\n### [Carthage](https://github.com/Carthage/Carthage)\n\nTo install add the following line to your Cartfile:\n\n`github \"vikmeup/SCLAlertView-Swift\" \"master\"`\n\nCollaboration\n---\n\nI tried to build an easy to use API, while beeing flexible enough for multiple variations, but I'm sure there are ways of improving and adding more features, so feel free to collaborate with ideas, issues and/or pull requests.\n\nIncoming improvements\n---\n\n- More animations\n- Performance tests\n\nHas been developed initially for the [Scroll Feed](https://itunes.apple.com/us/app/scroll-feed/id842422195?ls=1\u0026mt=8) app\n\n- Design [@SherzodMx](https://twitter.com/SherzodMx) Sherzod Max\n- Development [@vikmeup](https://twitter.com/vikmeup) Viktor Radchenko\n- Improvements by [@bih](http://github.com/bih) Bilawal Hameed, [@rizjoj](http://github.com/rizjoj) Riz Joj\n","funding_links":[],"categories":["UI","Uncategorized","Libs","Content","UI [🔝](#readme)","Minor"],"sub_categories":["Alert \u0026 Action Sheet","Uncategorized","UI","Alert","Other free courses","Pop Up"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvikmeup%2FSCLAlertView-Swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvikmeup%2FSCLAlertView-Swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvikmeup%2FSCLAlertView-Swift/lists"}