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.
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.