Latest 1.0.1
Homepage https://github.com/pontake-dev/PTDAlertViewController
License MIT
Platforms ios 8.0
Authors

Carthage compatible
Version
License
Platform

PTDAlertViewController is a wrapper around UIalertController that displays Alerts with simple code.
PTDAlertViewControllerはアラートダイアログをシンプルなコードで実装するためのUIalertControllerのラッパーです。

Description

  • Message dialogue display with no button.
    ボタンなしのメッセージダイアログ表示します。

    After a certain number of seconds have elapsed, a message dialog will be displayed which closes automatically. You can also specify the number of seconds to close.
    And, by tapping outside of the message dialog, the user can erase the dialog immediately.
    ある秒数が経過したら自動的に閉じるメッセージダイアログを表示します。閉じる秒数は指定することもできます。
    メッセージダイアログの外をタップすることによって、ダイアログを消去することができます。
    sample image001

  • Message dialogue display that displays one button.
    ボタンを1つだけ表示させるメッセージダイアログ表示。

    You can detect that you tapped the dialog button with a closure.
    ダイアログのボタンをタップした事をクロージャで取得できます。
    sample image001

  • Message dialogue display to display two buttons.
    ボタンを2つ表示させるメッセージダイアログ表示。

    You can detect that you tapped the dialog button with a closure.
    ダイアログのボタンをタップした事をクロージャで取得できます。
    sample image001

Example Usages

// MARK: Message dialogue display with no button.

PTDAlertViewController.showDialog(title: "title", message: "message")
//When specifying all arguments
PTDAlertViewController.showDialog(title: nil, message: "message", animated: true, showTime: 1.0)

// MARK: Message dialogue display that displays one button.

PTDAlertViewController.showYesOnlyAlert(title: "title", message: "message") {
    print("Alert Yes button tapped.")
}
//When specifying all arguments
PTDAlertViewController.showYesOnlyAlert(title: nil, message: "message", yesButtonMessage: "agree", animated: true) {
    print("Alert Yes button tapped.")
}

// MARK: Message dialogue display to display two buttons.
PTDAlertViewController.showYesNoAlert(title: "title", message: "message") { (isYesTapped) in
    if isYesTapped {
        print("Alert Yes button tapped.")
    } else {
        print("Alert No button tapped.")
    }
}
//When specifying all arguments
PTDAlertViewController.showYesNoAlert(title: nil, message: "message", yesButtonMessage: "done", noButtonMessage: "cancel", animated: true) { (isYesTapped) in
    if isYesTapped {
        print("Alert Yes button tapped.")
    } else {
        print("Alert No button tapped.")
    }
}

Installation

CocoaPods

Add to Podfile:

pod 'PTDAlertViewController'

Carthage

Add to Cartfile:

github "pontake-dev/PTDAlertViewController"

License

MIT

Latest podspec

{
    "name": "PTDAlertViewController",
    "version": "1.0.1",
    "summary": "PTDAlertViewController is a wrapper around UIalertcontroller that displays Alerts with simple code.",
    "description": "PTDAlertViewController is a wrapper around UIalertcontroller that displays Alerts with simple code.nnExample Usagesnn```swiftn// MARK: Message dialogue display with no button.nnPTDAlertViewController.showDialog(title: "title", message: "message")n//When specifying all argumentsnPTDAlertViewController.showDialog(title: nil, message: "message", animated: true, showTime: 1.0)nn// MARK: Message dialogue display that displays one button.nnPTDAlertViewController.showYesOnlyAlert(title: "title", message: "message") {n    print("Alert Yes button tapped.")n}n//When specifying all argumentsnPTDAlertViewController.showYesOnlyAlert(title: nil, message: "message", yesButtonMessage: "agree", animated: true) {n    print("Alert Yes button tapped.")n}nn// MARK: Message dialogue display to display two buttons.nPTDAlertViewController.showYesNoAlert(title: "title", message: "message") { (isYesTapped) inn    if isYesTapped {n        print("Alert Yes button tapped.")n    } else {n        print("Alert No button tapped.")n    }n}n//When specifying all argumentsnPTDAlertViewController.showYesNoAlert(title: nil, message: "message", yesButtonMessage: "done", noButtonMessage: "cancel", animated: true) { (isYesTapped) inn    if isYesTapped {n        print("Alert Yes button tapped.")n    } else {n        print("Alert No button tapped.")n    }n}n```",
    "homepage": "https://github.com/pontake-dev/PTDAlertViewController",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "pontake-dev": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "swift_version": "4.0",
    "source": {
        "git": "https://github.com/pontake-dev/PTDAlertViewController.git",
        "tag": "1.0.1"
    },
    "source_files": "PTDAlertViewController/**/*.{swift}"
}

Pin It on Pinterest

Share This