Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
- (void)showCustomAlertController:(NSString *)title
message:(NSString *)message
firstButtonTitle:(NSString *)firstButtonTitle
secondButtonTitle:(NSString *)secondButtonTitle
tag:(NSString *)tag
delegate:(id<CustomAlertViewControllerDelegate>)delegate {
CustomAlertViewController *alertController =
[[CustomAlertViewController alloc] initWithNibName:@"CustomAlertViewController" bundle:nil];
// Below method call loads iboutlets to the memory otherwise you cannot set titles etc.
[alertController view];
if (delegate == nil) {
[alertController setTitle:title
message:message
firstButtonTitle:firstButtonTitle
secondButtonTitle:secondButtonTitle
delegate:self];
} else {
[alertController setTitle:title
message:message
firstButtonTitle:firstButtonTitle
secondButtonTitle:secondButtonTitle
delegate:delegate];
}
alertController.tag = tag;
[self.navigationController presentViewController:alertController animated:true completion:nil];
}
- (void)firstAlertViewButtonClicked:(CustomAlertViewController *)customAlertViewController {
[self.navigationController dismissViewControllerAnimated:true completion:^{}];
}
- (void)secondAlertViewButtonClicked:(CustomAlertViewController *)customAlertViewController {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.