Skip to content

hkm5558/KMAlertView

Repository files navigation

KMAlertView

一款自定义的AlertView

What’s it look like?

NoneBlur

LightBlur

DarkBlur

Animate

Installation with CocoaPods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries. You can install it with the following command:

$ gem install cocoapods

Podfile

To integrate KMAlertView into your Xcode project using CocoaPods, specify it in your Podfile:

In your Podfile

pod 'KMAlertView'

Then, run the following command:

$ pod install

Requirements

This library requires iOS 8.0+

Usage

    ///Title only
    [KMAlertView showAlertWithTitle:@"Title only"];

    ///Message only
    [KMAlertView showAlertWithMessage:@"Message only"];
    
    ///Title & Message & CallBackBlock
    [KMAlertView showAlertWithTitle:self.shortTitle message:self.shortMessage callBackBlock:^(NSInteger buttonIndex, NSString *buttonTitle) {
    
    }];
    
    ///Title & Message & ButtonTitles & CallBackBlock
    [KMAlertView showAlertWithTitle:@"Title" message:@"Message" buttonTitles:@[@"button1", @"button2"] callBackBlock:^(NSInteger buttonIndex, NSString *buttonTitle) {
    
    }];
    
    ///Setting With StyleConfigBlock
    [KMAlertView showAlertWithStyleConfigBlock:^KMAlertStyle *(KMAlertStyle *alertStyle) {
        return [KMAlertStyle new];
    } callBackBlock:^(NSInteger buttonIndex, NSString *buttonTitle) {
    
    }];
    
    ///ButtonTitles & StyleConfigBlock
    [KMAlertView showAlertWithButtonTitles:@[@"button1", @"button2"] styleConfigBlock:^KMAlertStyle *(KMAlertStyle *alertStyle) {
        return [KMAlertStyle new];
    } callBackBlock:^(NSInteger buttonIndex, NSString *buttonTitle) {
    
    }];
    
    ///AlertView Dismiss
    [alertView dismissWithCompletion:^{
    
    }];

Author

hkm5558, SZHuangKM@163.com

License

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