0

enter image description here

My code is like:

UIImage *imk= [UIImage imageWithData:imageData];



    UIAlertController * alert=   [UIAlertController
                                  alertControllerWithTitle:@"Success"
                                  message:@"Posted Successfully."
                                  preferredStyle:UIAlertControllerStyleAlert];

    UIAlertAction *Action=[[UIAlertAction alloc]init];
    [Action setValue:imk forKey:@"image"];
    [alert addAction:Action];

            [self presentViewController:alert animated:YES completion:nil];
Suraj Sukale
  • 1,778
  • 1
  • 12
  • 19
ragu
  • 133
  • 2
  • 10

1 Answers1

0

Do like this way.. it will help :

    UIAlertController * alert=   [UIAlertController
                                  alertControllerWithTitle:@"Success"
                                  message:@"Posted Successfully."
                                  preferredStyle:UIAlertControllerStyleAlert];

UIAlertAction* action = [UIAlertAction
                     actionWithTitle:@"Title"
                     style:UIAlertActionStyleDefault
                     handler:^(UIAlertAction * action)
                     {
                         [view dismissViewControllerAnimated:YES completion:nil];

                     }];
[action setValue:[[UIImage imageNamed:@"img.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forKey:@"image"];
[alert addAction:action];
[self presentViewController:alert animated:YES completion:nil];
Suraj Sukale
  • 1,778
  • 1
  • 12
  • 19