Latest 1.1.0
Homepage https://github.com/szk-atmosphere/MOAlertController
License MIT
Platforms ios 7.0, requires ARC
Authors

Version
License
Platform

You do not have to consider gap iOS7 and iOS8 when you use UIAlertController!!

MOAlertController has same feature at UIAlertController because it is wapper class for UIAlertController, UIAlertView and UIActionSheet.

  • Alert
  • ActionSheet

iOS7

iOS7

iOS8

iOS8

Usage

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

For Alert

Set MOAlertControllerStyleAlert to preferredStyle.


    MOAlertController *alertController = [MOAlertController alertControllerWithTitle:@"MOAlertController" message:@"This is MOAlertController." preferredStyle:MOAlertControllerStyleAlert];

    MOAlertAction *action = [MOAlertAction actionWithTitle:@"Cancel" style:MOAlertActionStyleCancel handler:^(MOAlertAction *action) {
        //Write a code for this action.
    }];
    [alertController addAction:action];

    MOAlertAction *action2 = [MOAlertAction actionWithTitle:@"Destructive" style:MOAlertActionStyleDestructive handler:^(MOAlertAction *action) {
        //Write a code for this action.
    }];
    [alertController addAction:action2];

    MOAlertAction *action3 = [MOAlertAction actionWithTitle:@"Default" style:MOAlertActionStyleDefault handler:^(MOAlertAction *action) {
        //Write a code for this action.
    }];
    [alertController addAction:action3];

    [controller presentViewControllerWithCurrentViewController:self];;

For Action Sheet

Set MOAlertControllerStyleActionSheet to preferredStyle.


    MOAlertController *alertController = [MOAlertController alertControllerWithTitle:@"MOAlertController" message:@"This is MOAlertController." preferredStyle:MOAlertControllerStyleActionSheet];

    MOAlertAction *action = [MOAlertAction actionWithTitle:@"Cancel" style:MOAlertActionStyleCancel handler:^(MOAlertAction *action) {
        //Write a code for this action.
    }];
    [alertController addAction:action];

    MOAlertAction *action2 = [MOAlertAction actionWithTitle:@"Destructive" style:MOAlertActionStyleDestructive handler:^(MOAlertAction *action) {
        //Write a code for this action.
    }];
    [alertController addAction:action2];

    MOAlertAction *action3 = [MOAlertAction actionWithTitle:@"Default" style:MOAlertActionStyleDefault handler:^(MOAlertAction *action) {
        //Write a code for this action.
    }];
    [alertController addAction:action3];

    [controller presentViewControllerWithCurrentViewController:self];

If you want to dismiss, use this method.


[controller dismissViewControllerFromCurrentViewController];

Requirements

  • iOS 7.0 and greater
  • ARC

Installation

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

pod "MOAlertController"

Author

Taiki Suzuki, [email protected]

License

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

Latest podspec

{
    "name": "MOAlertController",
    "version": "1.1.0",
    "summary": "MOAlertController is wapper class to assign UIAlertController, UIAlertView and UIActionSheet.",
    "homepage": "https://github.com/szk-atmosphere/MOAlertController",
    "license": "MIT",
    "authors": {
        "Taiki Suzuki": "[email protected]"
    },
    "source": {
        "git": "https://github.com/szk-atmosphere/MOAlertController.git",
        "tag": "1.1.0"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "MOAlertController/*.{h,m}"
}

Pin It on Pinterest

Share This