{"id":19500901,"url":"https://github.com/jwd-ali/jdalertcontroller","last_synced_at":"2025-04-25T23:30:47.218Z","repository":{"id":37666317,"uuid":"344445206","full_name":"jwd-ali/JDAlertController","owner":"jwd-ali","description":"JDAlertController is AlertController replica that can significantly enhance your users experiences and set your app apart from the rest of the pack. You don’t need to do much to integrate it.Its build using UIViewControllerTransitioningDelegate and UIPresentationController having four types of UIViewControllerAnimatedTransitioning animations and many more customisations with different buttons styles and UITextField support as well","archived":false,"fork":false,"pushed_at":"2021-07-20T13:26:20.000Z","size":4603,"stargazers_count":17,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-13T19:42:32.570Z","etag":null,"topics":["alert","alertcontroller","alertview-alertviewcontroller","animation","custom-transitions","popover","popup","swift5","swiftlint","uibezierpath"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jwd-ali.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}},"created_at":"2021-03-04T11:05:44.000Z","updated_at":"2023-03-03T21:30:14.000Z","dependencies_parsed_at":"2022-08-20T21:20:22.981Z","dependency_job_id":null,"html_url":"https://github.com/jwd-ali/JDAlertController","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwd-ali%2FJDAlertController","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwd-ali%2FJDAlertController/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwd-ali%2FJDAlertController/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwd-ali%2FJDAlertController/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jwd-ali","download_url":"https://codeload.github.com/jwd-ali/JDAlertController/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250912660,"owners_count":21506865,"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","alertcontroller","alertview-alertviewcontroller","animation","custom-transitions","popover","popup","swift5","swiftlint","uibezierpath"],"created_at":"2024-11-10T22:10:20.044Z","updated_at":"2025-04-25T23:30:46.471Z","avatar_url":"https://github.com/jwd-ali.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://github.com/jwd-ali/TidalTestProject/blob/master/images/header/header.png\"\u003e\n\u003cimg align=\"right\" src=\"https://github.com/jwd-ali/JDAlertController/blob/main/images/JDAlertController.gif\" width=\"480\" /\u003e\n\u003cp\u003e\u003ch1 align=\"left\"\u003eJDAlertController\u003c/h1\u003e\u003c/p\u003e\n\n[![CI Status](https://travis-ci.org/jwd-ali/RingPieChart.svg)](https://travis-ci.org/jwd-ali/RingPieChart)\n[![CocoaPods Version](https://img.shields.io/cocoapods/v/RingPieChart.svg?style=flat)](https://cocoapods.org/pods/RingPieChart)\n[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-0473B3.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![License](https://img.shields.io/cocoapods/l/RingPieChart.svg?style=flat)](https://cocoapods.org/pods/RingPieChart)\n[![Platform](https://img.shields.io/cocoapods/p/RingPieChart.svg?style=flat)](https://cocoapods.org/pods/RingPieChart)\n[![Swift 5.1](https://img.shields.io/badge/swift-5.1-orange)](https://swift.org)\n\n\u003cp\u003e\u003ch4\u003eJDAlertController is AlertController replica that can significantly enhance your users’ experiences and set your app apart from the rest of the pack.\u003c/h4\u003e\u003c/p\u003e\n\n___\nYou don’t need to do much to integrate it. Its build using UIViewControllerTransitioningDelegate and UIPresentationController having four types of UIViewControllerAnimatedTransitioning animations and many more customisations with different buttons styles and UITextField support as well\n\nError and Success Animations are build using CABasicAnimation and CAShapeLayer through UIBezierpath. Its fun to play with CoreGraphics.It starts slow and By the end, you’ll be able to create stunning graphics for your apps.\n\u003cp\u003e \n  \n\n\u003ca href=\"https://www.linkedin.com/in/jawad-ali-3804ab24/\"\u003e\u003cimg src=\"https://i.imgur.com/vGjsQPt.png\" width=\"134\" height=\"34\"\u003e\u003c/a\u003e  \n\n\u003c/br\u003e\u003c/br\u003e\n## Requirements\n\n- iOS 11.0+ / Mac OS X 10.9+ / watchOS 2.0+ / tvOS 9.0+\n- Xcode 8.0+\n\n## Installation\n\n### [CocoaPods](http://cocoapods.org)\n\nTo integrate **JDAlertController** into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n```ruby\nuse_frameworks!\n\npod 'JDAlertController'\n```\n\nThen, run the following command:\n\n```bash\n$ pod install\n```\n### [Carthage](http://github.com/Carthage/Carthage)\n\nTo integrate `JDAlertController` into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n```ogdl\ngithub \"jwd-ali/JDAlertController\"\n```\n\n### [Swift Package Manager (SPM)](https://swift.org/package-manager)\n\n#### Prerequisites\n- OSX\n\n\n#### Update `Package.swift`\nTo integrate `JDAlertController` in your project, add the proper description to your `Package.swift` file:\n```swift\n// swift-tools-version:5.0\nimport PackageDescription\n\nlet package = Package(\n    name: \"YOUR_PROJECT_NAME\",\n    dependencies: [\n        .package(url: \"https://github.com/jwd-ali/JDAlertController.git\")\n    ],\n    targets: [\n        .target(\n            name: \"YOUR_TARGET_NAME\",\n            dependencies: [\"JDAlertController\"]\n        ),\n        ...\n    ]\n)\n```\n\n### Manually\n\nIf you prefer not to use a dependency manager, you can integrate JDAlertController into your project manually.\n\n- Add sources into your project:\n  - Drag `Sources`\n\n## Usage\n\n\u003e If you are using any dependency manager (pods , carthage , package manager)to integrate JDAlertController. Import JDAlertController first:\n\u003e ```swift\n\u003e import JDAlertController\n\u003e ```\n\n\u003e And for Manuall install you dont need to import anything \n\n- Init your ring with  `Alert` same as you initialize default `UIAlertController`:\n```swift\n  let alert = AlertController(icon: UIImage(named: \"iconName\"),\n                                    title: \"Can We Help?\",\n                                    message: \"Any questions or feedback? We are here to help you! \",\n                                    preferredStyle: .alert)\n```\nWe can show alert with 4 different styles \n\n```swift\npublic enum PopupStyle {\n    case alert\n    case actionSheet(offset: Double)\n    case topSheet(offset: Double)\n    case dragIn\n}\n```\n\nAction sheet and top sheet support offset as well if you want to position it some point rather then attaching to bottom or top\nYou can also set the icon size in the initializer like this \n\n```swift\nlet alert = AlertController(icon: UIImage(named: \"write\"),\n                                    title: \"Can We Help?\",\n                                    message: \"Any questions or feedback? We are here to help you! \",\n                                    preferredStyle: Settings.shared.preferedStyle,\n                                    iconSize: 80)\n```\n\nHere you are giving top icon size to 80 points\n\nYou can enable touch anywhere outside the alert to dismiss it on \n\n```swift\nalert.tapToClose = true\n\n```\nIf its On user can tap anywhere outside popup to dismiss it.\n\nYou can also enable draging and fast drag dismiss by setting the key `isDragEnable` \n\n```swift\nalert.isDragEnable = true\n\n```\nYou can control the width of the popup using key `widthRatio` ita ratio of total screen width. its value should be in range 0...1 \n\n```swift\nalert.widthRatio = 0.8\n\n```\n\nFor Animated success or failure you need to set PopupType in inializer like this\n\n```swift\npublic enum PopupType {\n    case success\n    case error\n}\n\nlet alert = AlertController(type: .success,\n                                    title: \"Awaiting your payment!\",\n                                    message: \"Leo Walton will receive \\n 62,500.00 PKR \",\n                                    preferredStyle: Settings.shared.preferedStyle)\n\n```\n\nAnd set the `isAnimated` property to true if you want Top to bottom animation like unfolding\n\n\n```swift\n alert.isAnimated = true\n```\n\n\nAdding `buttons` and `TextFields` in alert is as simple as adding them in Alert controller\n\n```swift\n let homeAction = PopupAction(title: \"No, Thanks\",\n                                     style: .classic(cornerRadius: 5),\n                                     propotionalWidth: .margin) {\n\n        }\n        \n        alert.addAction(homeAction)\n```\n\nSame as AlertController we get closure to do actions while declaring buttons and dismissal of popup is auto so you dont need to dismiss the alert on taping of the button\nWe have different style buttons available to inject into the Action\n\n```swift\n public enum Style {\n\n        case `default`\n        case bold\n        case destructive\n        case round\n        case classic(cornerRadius: CGFloat)\n        case justText\n    }\n```\nI think they are self explainatory as their name. Also you can have sizes of buttons as well\n\n```swift\npublic enum ButtonWidth {\n        case full\n        case margin\n        case normal\n        case custom(ratio: CGFloat)\n    }\n```\nWhere full are full width and you can also have custom width and marginal width as well\nhere is the propotinal width graph\n\n```swift\nvar buttonSize: CGFloat {\n            switch propotionalWidth {\n            case .full:\n                return 1.0\n            case .margin:\n                return 0.9\n            case .normal:\n                return 0.75\n            case .custom(let width):\n                return width\n            }\n        }\n```\n\nIt explain the width of the button\n\nAdding Text fields is also as easy as its native control\n\n```swift\n let emailField = AppTextField(with: \"User Name or Email\")\n        let passwordField = AppTextField(with: \"Password\")\n        passwordField.isSecureTextEntry = true\n\n        alert.addTextField(emailField)\n        alert.addTextField(passwordField)\n\n```\n\nAnd then you can access them like this\n\n```swift\n  let firstTextField =  alert.textFields.first\n  ```\n\nCongratulations! You're done.\n\n\n## Contributing\n\nI’d love to have help on this project. For small changes please [open a pull request](https://github.com/jwd-ali/JDAlertController/pulls), for larger changes please [open an issue](https://github.com/jwd-ali/JDAlertController/issues) first to discuss what you’d like to see.\n\n\nLicense\n-------\n\nJDAlertController is under [MIT](https://opensource.org/licenses/MIT). See [LICENSE](LICENSE) file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwd-ali%2Fjdalertcontroller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwd-ali%2Fjdalertcontroller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwd-ali%2Fjdalertcontroller/lists"}