- (void)aleartViewShowtTittle:(NSString *)tittle message:(NSString *)message ok:(NSString *)ok other:(NSString *)other other2:(NSString *)other2 cancel:(NSString *)cancel {
UIAlertController *altc =[UIAlertController alertControllerWithTitle:tittle message:message preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:cancel style:UIAlertActionStyleCancel handler:nil];
UIAlertAction *okAction = [UIAlertAction actionWithTitle:ok style:UIAlertActionStyleDefault handler:nil];
UIAlertAction *othe = [UIAlertAction actionWithTitle:other style:UIAlertActionStyleDefault handler:nil];
UIAlertAction *othe2 = [UIAlertAction actionWithTitle:other2 style:UIAlertActionStyleDefault handler:nil];
// UIAlertAction *othe = [UIAlertAction actionWithTitle:other style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
// SendServiceViewController *ssvc = [[self storyboard] instantiateViewControllerWithIdentifier:@"SendServiceView"];
// [self showViewController:ssvc sender:nil];
[self show]
// }];
// UIButton *button = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 20, 20)];
// [button addTarget:self action:@selector(action) forControlEvents:UIControlEventTouchUpInside];
if (![ok isEqualToString:@""]) {
[altc addAction:cancelAction];
}
if (![other isEqualToString:@""]) {
[altc addAction:okAction];
}
if (![other2 isEqualToString:@""]) {
[altc addAction:othe];
}
if (![cancel isEqualToString:@""]) {
[altc addAction:othe2];
}
[self presentViewController:altc animated:YES completion:nil];
}
UIAlertController *altc =[UIAlertController alertControllerWithTitle:tittle message:message preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:cancel style:UIAlertActionStyleCancel handler:nil];
UIAlertAction *okAction = [UIAlertAction actionWithTitle:ok style:UIAlertActionStyleDefault handler:nil];
UIAlertAction *othe = [UIAlertAction actionWithTitle:other style:UIAlertActionStyleDefault handler:nil];
UIAlertAction *othe2 = [UIAlertAction actionWithTitle:other2 style:UIAlertActionStyleDefault handler:nil];
// UIAlertAction *othe = [UIAlertAction actionWithTitle:other style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
// SendServiceViewController *ssvc = [[self storyboard] instantiateViewControllerWithIdentifier:@"SendServiceView"];
// [self showViewController:ssvc sender:nil];
[self show]
// }];
// UIButton *button = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 20, 20)];
// [button addTarget:self action:@selector(action) forControlEvents:UIControlEventTouchUpInside];
if (![ok isEqualToString:@""]) {
[altc addAction:cancelAction];
}
if (![other isEqualToString:@""]) {
[altc addAction:okAction];
}
if (![other2 isEqualToString:@""]) {
[altc addAction:othe];
}
if (![cancel isEqualToString:@""]) {
[altc addAction:othe2];
}
[self presentViewController:altc animated:YES completion:nil];
}