Latest 0.6.0
License MIT
Platforms ios 9.0

CI Status

## Introduction

YAlert is a customized alert view controller featuring the ability to specify a banner image, title, message, primary button action and secondary button action.

## Usage

In your view controller, you can initialize and present an AlertViewController instance using the following code:

let alertVC = AlertViewController(bannerImageName: “banner”,
title: “Alert #1”,
message: “This is a message”,
primaryButtonTitle: “Ok”,
secondaryButtonTitle: “Cancel”)
alertVC.tag = 1000
alertVC.delegate = self

There are two properties responsible for handling user events when AlertViewController is present.

`delegate` allows your view controller to receive and handle primary button, secondary button, and background tap events.

`tag` allows you to differentiate AlertViewController instances when handling tap events. You may have different event handling logic based on the AlertViewController’s tag number.

extension ViewController: AlertViewControllerDelegate {
func didTapPrimaryButton(_ sender: AlertViewController) {
switch sender.tag {
case 1000:
case 2000:
print(“no tag”)

print(“primary button tapped”)

func didTapSecondaryButton(_ sender: AlertViewController) {
print(“secondary button tapped”)

func didTapBackground(_ sender: AlertViewController) {
print(“background tapped”)

## Installation

YAlert is available through [CocoaPods]( To install
it, simply add the following line to your Podfile:

pod “YAlert”

## Author

Leo Feng, [email protected]

## License

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

Latest podspec

    "name": "YAlert",
    "version": "0.6.0",
    "summary": "A customized alert view controller",
    "description": "A customized alert view controller featuring the ability to specify banner image, title, message, and two user actions.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Leo Feng": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.6.0"
    "platforms": {
        "ios": "9.0"
    "source_files": "YAlert/Classes/**/*",
    "pushed_with_swift_version": "3.0"

Pin It on Pinterest

Share This