To run the example project, clone the repo, and run pod install
from the Example directory first.
You should import header first
#import "AlertHelper.h"
If you want alert some text for tips, pls used
AlertText(self.view).title(@"这是一条提示信息").show(); // it will hide delay 1.5s, replace self.view to your target source view.
If you want alert and need operate some thing, pls used
AlertView(self.view).title(@"这是一条提示标题").message(@"这是一条提示信息").cancelButton(@"取消").confirmButton(@"确定").cancelHandler(^{
}).confirmHandler(^{
}).show();
If you want do some thing when dismiss completion, pls used
AlertText(self.view).title(@"这是一条提示信息").show().dismissHandler(^{
// do some thing at this.
});
If you want alert in the window, pls used
AlertTextInWindow().title(@"").show();
or
AlertViewInWindow().title(@"").message(@"").cancelButton(@"取消").confirmButton(@"确定").cancelHandler(^{
}).confirmHandler(^{
}).show();
If you want custom configuration, pls used
AlertText(self.view).title(@"").font([UIFont ..]).titleColor([UIColor ..]).show(); // it have some comtus set, pls use it.
also you can set global configuration like this
// declare the HelperConfigurationHandler object.
void CustomConfigurationForAlertHelper(ZZAlertHelper *alertHelper);
@interface ExampleClass()
@end
@implementation ExampleClass
// call this function at app launch<AppDelegate.m> or at the global app preference.
- (void)setupAppPerference
{
// call the function to set the HelperConfigurationHandler object at AlertHelper.m.
SetupZZAlertHelperConfiguration(CustomConfigurationForAlertHelper);
}
// setup custom config at here.
void CustomConfigurationForAlertHelper(ZZAlertHelper *alertHelper)
{
alertHelper.titleLabelTextColor = [UIColor blackColor];
alertHelper.textFont = [UIFont boldSystemFontOfSize:17];
}
@end
AlertHelper is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'AlertHelper'
SunnyXG, zhangx7635093@163.com, if you have any issues and suggest, please email to me, thanks.
AlertHelper is available under the MIT license. See the LICENSE file for more info.