ProductPromotion
Logo

Swift

made by https://0x3d.site

GitHub - GabrielAlva/Swift-Prompts: A Swift library to design custom prompts with a great scope of options to choose from.
A Swift library to design custom prompts with a great scope of options to choose from.  - GitHub - GabrielAlva/Swift-Prompts: A Swift library to design custom prompts with a great scope of options ...
Visit Site

GitHub - GabrielAlva/Swift-Prompts: A Swift library to design custom prompts with a great scope of options to choose from.

GitHub - GabrielAlva/Swift-Prompts: A Swift library to design custom prompts with a great scope of options to choose from.

License Pod Version Pod Platform Pod License Carthage compatible

Swift Prompts.

Installation

CocoaPods

Install with CocoaPods by adding the following to your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'

use_frameworks!

pod 'Swift-Prompts', '~> 1.0.0'

Note: We follow http://semver.org for versioning the public API.

Carthage

Using Carthage:

github "GabrielAlva/Swift-Prompts"

Manually

  • Just include the three .swift files found on the Swift Prompts folder on the demo Xcode project.

Usage

Using Swift Prompts is very simple and fast.

Adopting the prompt's delegate

In your class declaration, after specifying the type of class write SwiftPromptsProtocol as shown here:

class ViewController: UIViewController,  SwiftPromptsProtocol

Now, depending on the type of prompt, you can use any of the optional delegate functions

func clickedOnTheMainButton() {}
func clickedOnTheSecondButton() {}
func promptWasDismissed() {}

Displaying a prompt

First you need to declare a var outside of a function:

var prompt = SwiftPromptsView()

Next, where you would like to trigger the prompt (e.g. in the action function of a button):

prompt = SwiftPromptsView(frame: self.view.bounds)
prompt.delegate = self

//Customization

self.view.addSubview(prompt)

Dismissing a prompt

To dismiss the prompt, you can write this line in one of the delegate functions or in a different one:

prompt.dismissPrompt()

Alternatively, 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.

Customization

Once 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.

Example

You can find a full example on usage and customization on the Xcode project attached to this repository.

License

Source code of this project is available under the standard MIT license. Please have a look at the license file.

More Resources
to explore the angular.

mail [email protected] to add your project or resources here ๐Ÿ”ฅ.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here ๐Ÿ”.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory