Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //show alert
- -(void)showAlert:(NSString *)theTitle theMessage:(NSString *)theMessage alertTag:(int)alertTag {
- /*
- UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:theTitle message:theMessage delegate:self
- cancelButtonTitle:NSLocalizedString(@"ok", "OK") otherButtonTitles:nil];
- [alertView setTag:alertTag];
- [alertView show];
- */
- UIAlertController * alertView = [UIAlertController
- alertControllerWithTitle:theTitle
- message:theMessage
- preferredStyle:UIAlertControllerStyleAlert];
- UIAlertAction* yesButton = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
- //Handle your button action here
- [self clickedOnButton:199];
- }];
- UIAlertAction* noButton = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
- [self clickedOnButton:0];
- }];
- [alertView addAction:yesButton];
- [alertView addAction:noButton];
- [self presentViewController:alertView animated:YES completion:nil];
- }
- //
- -(void)clickedOnButton:(int)alertTag {
- [BT_debugger showIt:self message:[NSString stringWithFormat:@"alertView clickedButtonAtIndex: %d", alertTag]];
- if(alertTag == 0){
- // [self.navigationController popViewControllerAnimated:YES];
- }
- if(alertTag == 199){
- [self navLeftTap];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement