Giter VIP home page Giter VIP logo

jonalert's Introduction

JonAlert

CocoaPods Compatible License

A simple and elegant alert like Spotify's one, written in Swift. JonAlert can be used to give feedbacks to the user after he/she performed some action.

Gif

How to use

// First import the library to the ViewController you want to use it.
import JonAlert

// Then, you just have to call the alert anywhere you desire:
JonAlert.show(message: "Simple message...")

Success and Error Alerts

// If you want to show feedback for a success or error situation, 
// you can simply call:
JonAlert.showSuccess(message: "Success!!")
JonAlert.showError(message: "Something went wrong...")

Display a custom icon

// Last but not least, you can use a custom image to be displayed:
let myImage = UIImage(named: "myImage")
JonAlert.show(message: "Simple message...", andIcon: myImage)

Changing the alert displaying speed

// The alert default displaying speed is 1 second. So, when you
// call any of the "show" methods the time between the alert 
// appearing and disappearing will be of 1 second. 

// To change de default time (in seconds) of the alert, use: 
JonAlert.show(message: "", duration: 5.0)

Installation

CocoaPods

To integrate JonAlert to your project using CocoaPods, specify it in your Podfile:

target '<Your Target Name>' do
    pod 'JonAlert', :git => 'https://github.com/jonSurrey/JonAlert.git', :branch => 'master'
end

Then, run the following command:

$ pod install

Manual installation

First download the "JonAlert" folder. Then, in Xcode, right-click on the root of your project node in the project navigator. Click "Add Files" to “YOURPROJECTNAME”. In the file chooser, navigate to where "Jon Alert" folder is and select JonAlert.xcodeproj. Click "Add" to add JonAlert.xcodeproj as a sub-project.

Select the top level of your project node to open the project editor. Click the YOUR_PROJECT_NAME target, and then go to the General tab.

Scroll down to the Embedded Binaries section. Drag JonAlert.framework from the Products folder of JonAlert.xcodeproj onto this section.

Clean and rebuild the project and you should be good to go!

Collaboration

This is a simple libray that I created to help myself in my own work since I didnt find any other that would do what I wanted. I know that there is still here a lot of space for improvements and adding new features, so please, any ideas or issues, feel free to collaborate!

Author

Jonathan Martins, [email protected]

License

JonAlert is available under the MIT license. See the LICENSE file for more info.

jonalert's People

Contributors

jonathanjussi avatar jonsurrey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.