ZRAlertController 2.3.3

ZRAlertController 2.3.3

测试已测试
Lang语言 Obj-CObjective C
许可证 MIT
发布最后发布2016年10月

Victor Zhang维护。



  • By
  • Victor Zhang

一个令人愉快的警报视图框架,兼容 iOS 7.0 及更高版本。它既提供 Objective-C 又提供 Swift 版本。

第一种风格的用法

[[ZRAlertController defaultAlert] alertShowWithTitle:@"提示" message:@"这是一条空消息!" okayButton:@"Ok"];

效果照片

ZRAlertController Effect Photo 1

第二种风格的用法

[[ZRAlertController defaultAlert] alertShowWithTitle:@"Note" message:@"This is an empty message!" cancelButton:@"Cancel" okayButton:@"Ok" okayHandler:^{
    NSLog(@"You clicked the okay button.");
} cancelHandler:^{
    NSLog(@"You clicked the cancel button.");
}];

效果照片

ZRAlertController Effect Photo 2

第三种风格的用法

[[ZRAlertController defaultAlert] alertShowWithTitle:@"Note" message:@"This is an explanation message!" cancelButton:@"Cancel" okayButton:@"Okay" alertStyle:ZRAlertStyleSecureTextInput placeHolder:@"Type any character" okayHandler:^(UITextField *textFiled) {
    NSLog(@"Your input of textFiled is %@.", textFiled.text);
} cancelHandler:^(UITextField *textFiled) {
    NSLog(@"Your input of textFiled is %@.", textFiled.text);
}];

效果照片

ZRAlertController Effect Photo 3

第四种风格的用法

[[ZRAlertController defaultAlert] alertShowWithTitle:@"Note" 
                                  message:@"This is an explanation message!" 
                                  cancelButton:@"Cancel" okayButton:@"Ok" 
                                  alertStyle:ZRAlertStyleLoginAndPasswordInput 
                                  placeHolder1:@"Type an account" 
                                  placeHolder2:@"Type a passcode" 
                                  sureHandler:^(UITextField *textFiled1, UITextField *textFiled2) {
    NSLog(@"Your input of Sure textFiled1.text = %@, textFiled2.text = %@. ", textFiled1.text, textFiled2.text);
} abolishHandler:^(UITextField *textFiled1, UITextField *textFiled2) {
    NSLog(@"Your input of Abolish textFiled1.text = %@, textFiled2.text = %@. ", textFiled1.text, textFiled2.text);
}];

效果照片

ZRAlertController Effect Photo 4

第一种风格操作表的用法

[[ZRAlertController defaultAlert] actionViewWithTitle:nil cancel:@"cancel" others:@[@"aaa",@"bbb",@"ccc"] handler:^(int index, NSString * _Nonnull item) {
    NSLog(@"index = %d, item = %@. ", index, item);
}];

效果照片

ZRAlertController Effect Photo 1