0

The issue is UIAlertVIewController does not work properly on iPhone 8 or iPhone 6 with iOS 12. I need to display alert when not in a view controller and using below reference I’m able to do display alert

How to present UIAlertController when not in a view controller?

But when I tap on “OK” alert dismiss but the gray colored background does not go off, we have to kill the app only.Attached screenshot. enter image description here

Same code works good in iPhone X, not sure what could be wrong in below code.

UIAlertController *alertvc = [UIAlertController alertControllerWithTitle:@"Device Registeration Error" message:"Device Error" preferredStyle:UIAlertControllerStyleAlert];
[alertvc addAction:[UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleCancel handler:^(UIAlertAction * action) {}]];   
[[[UIApplication sharedApplication] delegate].window.rootViewController presentViewController:alertvc animated:YES completion:nil];

After tapping "OK" the grey background of the alert still exist, it does not go off, don't know where code is wrong.

Larme
  • 24,190
  • 6
  • 51
  • 81
sia
  • 1,872
  • 1
  • 23
  • 54

0 Answers0