SVProgressHUD
SVProgressHUD copied to clipboard
It does not show when KeyWindow has changed
- (UIWindow *)frontWindow { #if !defined(SV_APP_EXTENSIONS) NSEnumerator *frontToBackWindows = [UIApplication.sharedApplication.windows reverseObjectEnumerator]; for (UIWindow *window in frontToBackWindows) { BOOL windowOnMainScreen = window.screen == UIScreen.mainScreen; BOOL windowIsVisible = !window.hidden && window.alpha > 0; BOOL windowLevelSupported = (window.windowLevel >= UIWindowLevelNormal && window.windowLevel <= self.maxSupportedWindowLevel); //--------------------- // the window is not keyWindow will return nil when KeyWindow has changed BOOL windowKeyWindow = window.isKeyWindow; //------------------- if(windowOnMainScreen && windowIsVisible && windowLevelSupported && windowKeyWindow) { return window; } } #endif return nil; }
Some thoughts on this:
- Try showing it in the
containerView - Call
makeKeyWindowon the window - Increase
maxSupportedWindowLevel