Latest 6
Homepage https://github.com/DouKing/LVMAlertHUD
License MIT
Platforms ios 7.0, requires ARC
Authors

LVMAlertHUD

LVMAlertController

An alert control that follows the system’s API.

LVMAlertHUD

Usage

  • The basic

LVMAlertController *alertController = [LVMAlertController alertControllerWithTitle:@"TITLE" message:@"some message" preferredStyle:LVMAlertControllerStyleAlert];

LVMAlertAction *action = [LVMAlertAction actionWithTitle:@"OK" style:LVMAlertActionStyleDefault handler:nil];
[alertController addAction:action];

action = [LVMAlertAction actionWithTitle:@"Cancel" style:LVMAlertActionStyleCancel handler:^(LVMAlertAction * _Nonnull action) {
    NSLog(@"%@", action.title);
}];
[alertController addAction:action];

[alertController addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
   textField.placeholder = @"A text field placeholder";
}];

[self presentViewController:alertController animated:YES completion:nil];
  • support for DSL

LVMAlertController.alert
              .setupTitle(@"Title")
              .setupMessage(@"message")
              .addActionsWithTitles(@"ok", @"later", @"know", nil)
              .addCancelActionWithTitle(@"cancel")
              .actionsHandler(^(NSInteger index, LVMAlertAction *action) {
                 NSLog(@"click %ld, %@", index, action.title);
              })
.show(^{
    NSLog(@"show");
});

The other UI controls contain

  • LVMStatusBarHUD
  • LVMToastHUD

Install with CocoaPods

Add the following content to your Podfile.

pod 'LVMAlertHUD'

OR

pod 'LVMAlertHUD/AlertController' 
pod 'LVMAlertHUD/StatusBarHUD'
pod 'LVMAlertHUD/Toast'

Compatibility

  • iOS 8.0+
  • Xcode 9.4

License

See LICENSE.

Latest podspec

{
    "name": "LVMAlertHUD",
    "version": "6",
    "summary": "u4effu7cfbu7edfAPIu5f39u6846",
    "homepage": "https://github.com/DouKing/LVMAlertHUD",
    "license": "MIT",
    "authors": {
        "wuyikai": "[email protected]"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source": {
        "git": "https://github.com/DouKing/LVMAlertHUD.git",
        "tag": "6"
    },
    "source_files": "LVMAlertHUD/Source/**/*.{h,m}",
    "resources": "LVMAlertHUD/Source/**/*.png",
    "requires_arc": true,
    "subspecs": [
        {
            "name": "AlertController",
            "source_files": [
                "LVMAlertHUD/Source/AlertController/**/*.{h,m}",
                "LVMAlertHUD/Source/Helper/**/*.{h,m}",
                "LVMAlertHUD/Source/LVMAlertHeader.h"
            ],
            "dependencies": {
                "pop": []
            }
        },
        {
            "name": "StatusBarHUD",
            "source_files": [
                "LVMAlertHUD/Source/StatusBarHUD/**/*.{h,m}",
                "LVMAlertHUD/Source/Resource/*"
            ]
        },
        {
            "name": "Toast",
            "source_files": "LVMAlertHUD/Source/Toast/**/*.{h,m}",
            "dependencies": {
                "pop": []
            }
        }
    ]
}

Pin It on Pinterest

Share This