Latest 0.1.0
License MIT
Platforms ios 8.0, requires ARC



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

GNAlertConveniences extends UIViewController with a few handy methods to help present basic UIAlertControllers without all the boilerplate code.

Note: The button titles come localized, but the UIAlertController title and message must be localized before being passed into these methods.


public func showAlertControllerWithTitle(title:String, message:String, okActionBlock:GNVoidCompletionBlock? = nil)

This will show a UIAlertController with one button titled "Ok". This button calls the okActionBlock.

public func showAlertControllerWithTitle(title:String, message:String, okActionBlock:GNVoidCompletionBlock, cancelActionBlock:GNVoidCompletionBlock? = nil)

This will show a UIAlertController with two buttons. One of these buttons is titled "Ok", and the other is titled "Cancel". This is useful when the user is presented the controller as a means of either confirming or cancelling an action. The okActionBlock is called when the "Ok" button is pressed and the cancelActionBlock is called when the "Cancel" button is pressed.

public func showAlertControllerWithTitle(title:String, message:String, actions:[UIAlertAction])

This shows a UIAlertController with the designated title, message, and actions. This function is ultimately used by the previous two, but there was really no harm in having it as a public function as well.

To Do

  • [ ] Write simple convenience methods for ActionSheet style UIAlertControllers.


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

pod "GNAlertConveniences"


Gonzalo Nunez, [email protected]


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

Latest podspec

    "name": "GNAlertConveniences",
    "version": "0.1.0",
    "summary": "A UIViewController extension designed to simplify your life when presenting a UIAlertController.",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "Gonzalo Nunez": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.1.0"
    "platforms": {
        "ios": "8.0"
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "GNAlertConveniences": [

Pin It on Pinterest

Share This