0

My app start by loading files at the splash image with progressHUD window. In appDelegate i check if the location service in on,if its ON so no problem,after finish loading, the progressHUD disappear,but if the user getting alert that request permission for location services it's appears behind the progressHUD windows and i cant cancel/ok it while the app is loading.

How can i show this alert always on top of all other views,specially at begging on top of splash progressHUD?

vadim
  • 119
  • 3
  • 14

1 Answers1

0

Which HUD control are you using?

I am personally using SVProgressHUD which is really cool and complete… but has one single drawback: it creates its own UIWindow to display the HUD on top over everything. This behavior is not recommended by Apple and does not work, as you just realized, when the system creates its own UIWindows especially to display UIAlertViews.

The solution I used is to modify SVProgressHUD to add itself on top of the application's window.rootViewController.view, so that it stays on top of everything… in its own main window, letting stuff like UIAlertViews being displayed on their private window that is on top of this one, and thus letting you interact with UIAlertViewseven when your progressHUD is visible.


(If you are not using SVProgressHUD, the another class you use probably does have the same issue, so check with that one)

I should have posted a pull request to SVProgressHUD but didn't have the time yet. Will probably do anytime soon if I don't forget ;)

AliSoftware
  • 32,623
  • 6
  • 82
  • 77
  • I'm using the basic `MBProgressHUD`. Didn't understood how exactly you modify it so`UIAlertViews` being displayed? Basically i need it only for one alert-`location service`, cant I some how to control this specific alert? – vadim Oct 01 '12 at 22:33
  • No you can't control on which window `UIAlertViews` are displayed (and certainly not `UIAlertView` displayed by the OS itself as the one used by the location service). I don't use `MBProgressHUD` but if it has the same behavior and issue as the one I explained, using its own window on top of everything, even system alert views, then you'll need your progress HUD to be displayed in your main view directly instead of a separate window (I don't really use MBProgressHUD so you'll have to check in the code or contact the developer about this). – AliSoftware Oct 01 '12 at 22:49