-(void)dialog:(NSString*)title okTitle:(NSString*)okTitle placeholder:(NSString*)placeholder finish:(UIAlertControllerSuccess)finish {
UIAlertController* alert = [UIAlertController alertControllerWithTitle:title message:nil preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:okTitle style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
// UITextField* edictTextField = alert.textFields[0];
// DLOG(@"点击了ok %@", edictTextField.text);
finish(1, alert.textFields);
}];
UIAlertAction* cancel = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
[alert dismissViewControllerAnimated:YES completion:nil];
finish(0, alert.textFields);
// UITextField* edictTextField = alert.textFields[0];
// DLOG(@"点击了cancel %@", edictTextField.text);
}];
[alert addAction:defaultAction];
[alert addAction:cancel];
[alert addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
textField.placeholder = @"输入1";
}];
[alert addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
textField.placeholder = @"输入2";
}];
[alert addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
textField.placeholder = @"输入3";
}];
[self presentViewController:alert animated:YES completion:nil];
}