{"id":2409,"url":"https://github.com/GabrielAlva/Swift-Prompts","last_synced_at":"2025-08-06T16:30:53.082Z","repository":{"id":28910935,"uuid":"32435849","full_name":"GabrielAlva/Swift-Prompts","owner":"GabrielAlva","description":"A Swift library to design custom prompts with a great scope of options to choose from. ","archived":false,"fork":false,"pushed_at":"2018-04-24T03:30:18.000Z","size":47022,"stargazers_count":734,"open_issues_count":8,"forks_count":58,"subscribers_count":22,"default_branch":"master","last_synced_at":"2024-12-05T07:10:20.304Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GabrielAlva.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-18T03:30:05.000Z","updated_at":"2024-05-23T16:09:27.000Z","dependencies_parsed_at":"2022-08-02T17:15:13.100Z","dependency_job_id":null,"html_url":"https://github.com/GabrielAlva/Swift-Prompts","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabrielAlva%2FSwift-Prompts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabrielAlva%2FSwift-Prompts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabrielAlva%2FSwift-Prompts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabrielAlva%2FSwift-Prompts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GabrielAlva","download_url":"https://codeload.github.com/GabrielAlva/Swift-Prompts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228923680,"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:13.049Z","updated_at":"2024-12-09T16:30:59.453Z","avatar_url":"https://github.com/GabrielAlva.png","language":"Swift","readme":"![License](https://img.shields.io/badge/Language-Swift-brightgreen.svg?style=flat)\n[![Pod Version](http://img.shields.io/cocoapods/v/Swift-Prompts.svg?style=flat)](http://cocoadocs.org/docsets/Swift-Prompts/)\n[![Pod Platform](http://img.shields.io/cocoapods/p/Swift-Prompts.svg?style=flat)](http://cocoadocs.org/docsets/Swift-Prompts/)\n[![Pod License](http://img.shields.io/cocoapods/l/Swift-Prompts.svg?style=flat)](http://opensource.org/licenses/MIT)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n\n![Swift Prompts.](https://raw.githubusercontent.com/GabrielAlva/Swift-Prompts/master/MarkdownImage.png)\n\u003cbr /\u003e\n\u003cbr /\u003e\n\n## Installation\n### CocoaPods\n\nInstall with [CocoaPods](http://cocoapods.org) by adding the following to your Podfile:\n\n``` ruby\nsource 'https://github.com/CocoaPods/Specs.git'\nplatform :ios, '8.0'\n\nuse_frameworks!\n\npod 'Swift-Prompts', '~\u003e 1.0.0'\n```\n\n**Note**: We follow http://semver.org for versioning the public API.\n\n### Carthage\n\nUsing [Carthage](https://github.com/Carthage/Carthage):\n\n```\ngithub \"GabrielAlva/Swift-Prompts\"\n```\n\n### Manually\n* Just include the three .swift files found on the `Swift Prompts` folder on the demo Xcode project.\n\n## Usage \n\nUsing **Swift Prompts** is very simple and fast.\n\n### Adopting the prompt's delegate\n\nIn your class declaration, after specifying the type of class write `SwiftPromptsProtocol` as shown here:\n```swift\nclass ViewController: UIViewController,  SwiftPromptsProtocol\n```\n\nNow, depending on the type of prompt, you can use any of the optional delegate functions\n\n```swift\nfunc clickedOnTheMainButton() {}\nfunc clickedOnTheSecondButton() {}\nfunc promptWasDismissed() {}\n```\n\n### Displaying a prompt\n\nFirst you need to declare a var outside of a function:\n```swift\nvar prompt = SwiftPromptsView()\n```\n\nNext, where you would like to trigger the prompt (e.g. in the action function of a button):\n\n```swift\nprompt = SwiftPromptsView(frame: self.view.bounds)\nprompt.delegate = self\n\n//Customization\n\nself.view.addSubview(prompt)\n```\n\n### Dismissing a prompt\n\nTo dismiss the prompt, you can write this line in one of the delegate functions or in a different one:\n```swift\nprompt.dismissPrompt()\n```\nAlternatively, the dismissal by gesture is enabled by default so you can dismiss a prompt by moving it up or down until it dims completely. Dismissal by gesture will trigger the `promptWasDismissed()` delegate function.\n\n## Customization\n\nOnce you have your assigned the frame and delegate, you can customize the look and feel of your prompt and its background. You can customize almost every aspect of it as shown above including the width and height. The demo app is well documented for you to use any function of the customization API. To see the full list you can navigate to the `SwiftPromptsView` class and look for the API pragma mark. \n\n## Example\n\nYou can find a full example on usage and customization on the Xcode project attached to this repository.\n\n## License\n\nSource code of this project is available under the standard MIT license. \nPlease have a look at [the license file](LICENSE.md).\n","funding_links":[],"categories":["UI","Libs","Swift","UI [🔝](#readme)"],"sub_categories":["Alert \u0026 Action Sheet","UI","Other free courses"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGabrielAlva%2FSwift-Prompts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGabrielAlva%2FSwift-Prompts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGabrielAlva%2FSwift-Prompts/lists"}