shamshiranees / SAAlertView

Show Alert with a single line of code.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SAAlertView

CI Status Version License Platform

ScreenShots

ScreenShot ScreenShot ScreenShot

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Swift 3.0 Xcode 8.0

Installation

SAAlertView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'SAAlertView'

Usage

//Alert with title
SAAlertView.alertView("Alert Title")

//Alert with title and message
SAAlertView.alertView("Warning", message: "type you message here")

//Alert with single button action
SAAlertView.alertView("Waring", message: "type your message", buttonTitle: "retry", buttonAction: reload)

//Alert with multiple buttons
SAAlertView.multipleAlertView(title: "Question",message:"select a option",buttonTitles:["a","b","c","d","a","b","c","d"]) { (indexOfButton) in
if indexOfButton == 0{
print("a")
}
else if indexOfButton == 1{
print("b")
}else{

print("button clicked")
}
}

//ActionSheet with multiple buttons
SAAlertView.actionSheet(title: "options",buttonTitles:["a","b","c","d","a","b","c","d"]) { (indexOfButton) in
if indexOfButton == 0{
print("a")
}
else if indexOfButton == 1{
print("b")
}else{

print("button clicked")
}
}
}

Author

shamshir.anees@gmail.com

License

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

About

Show Alert with a single line of code.

License:MIT License


Languages

Language:Shell 63.4%Language:Swift 25.6%Language:Ruby 6.5%Language:Objective-C 4.5%