Skip to content

azatgoktas/AGAlertView

Repository files navigation

AGAlertView

CI Status Version License Platform

ScreenShots

Single Button Default Image

Demo

Two Button Custom Image

Demo

Two Button With Cancel

Demo

Example

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

Requirements

  • iOS 9 or newer

Installation

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

pod 'AGAlertView'

Author

Azat Goktas, azattgoktas@gmail.com

How To Use

Import The AGAlertView

import AGAlertView

Adding Button.

let button1 = AGButton(frame: .zero, title: "Button1")
AGAlert().showAlert(title: "Hey Yo", subtitle: "Thats it", buttons: button1)

Adding button and custom image. You can simply add action to your button.

let button1 = AGButton(frame: .zero, title: "Button1")
let button2 = AGButton(title: "Button2", selector: #selector(buttonTapped), target: self)
AGAlert().showAlert(title: "Hey Yo", subtitle: "Thats it", buttons: button1,button2, image: UIImage(named: "frog"))

Adding button with type of cancel.

let button1 = AGButton(frame: .zero, title: "Button1")
let button2 = AGButton(title: "Cancel",buttonStyle: .cancel)
AGAlert().showAlert(title: "Hey Yo", subtitle: "Thats it", buttons: button2,button1)

License

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