I am trying to show UIAlertController view while UIPopoverController view is open, but the alert view goes back of popover view like this.
How can I make the alert view to the foremost of the window?
Here is my code. Thank you.
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"test" message:@"test" preferredStyle:UIAlertControllerStyleAlert];
[alertController addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action)
{
}]];
[[[UIApplication sharedApplication] keyWindow].rootViewController presentViewController:alertController animated:YES completion:nil];