Latest 1.1.0
Homepage https://github.com/hyeon0145/UIAlertView-Block
License WTFPL
Platforms ios , requires ARC
Authors

UIAlertView category to replace UIAletViewDelegate by block

Usage

[[[UIAlertView alloc] initWithTitle:@"Alert" message:@"Do you want to delete this item?"
                  cancelButtonTitle:@"Cancel" otherButtonTitle:@"Delete"]
 showUsingBlock:^(UIAlertView *alertView, NSInteger buttonIndex) {
     if (buttonIndex == 1) {
         // delete
     }
 }];

[[[UIAlertView alloc] initWithTitle:@"Alert" message:@"What do you want?"
                  cancelButtonTitle:@"Cancel"
                  otherButtonTitles:@[@"Mark as unread", @"Archive", @"Delete"]]
 showUsingBlock:^(UIAlertView *alertView, NSInteger buttonIndex) {
     if (buttonIndex == 1) {
         // mark as unread
     } else if (buttonIndex == 2) {
         // archive
     } else if (buttonIndex == 3) {
         // delete
     }
 }];

[[[UIAlertView alloc] initWithMessage:@"Timer done"
                    cancelButtonTitle:@"Okay"]
 showUsingBlock:^(UIAlertView *alertView, NSInteger buttonIndex) {
    // stop timer sound
 }];

Latest podspec

{
    "name": "UIAlertView+Block",
    "version": "1.1.0",
    "summary": "UIAlertView category to replace UIAletViewDelegate by block",
    "homepage": "https://github.com/hyeon0145/UIAlertView-Block",
    "license": {
        "type": "WTFPL",
        "file": "LICENSE"
    },
    "authors": {
        "Jonghwan Hyeon": "[email protected]"
    },
    "platforms": {
        "ios": null
    },
    "source": {
        "git": "https://github.com/hyeon0145/UIAlertView-Block.git",
        "tag": "v1.1.0"
    },
    "source_files": "UIAlertView+Block.{h,m}",
    "requires_arc": true
}

Pin It on Pinterest

Share This