LGAlertView icon indicating copy to clipboard operation
LGAlertView copied to clipboard

Don't manipulate non-app windows

Open RishatShamsutdinov opened this issue 7 years ago • 5 comments

The lib always hides my non-app key window that I use for my custom controller in action sheet style that I use for photo picker.

UIWindow *keyWindow = LGAlertViewHelper.keyWindow;

[keyWindow endEditing:YES];

if (!hidden && keyWindow != LGAlertViewHelper.appWindow) {
    keyWindow.hidden = YES;
}

RishatShamsutdinov avatar Aug 04 '17 16:08 RishatShamsutdinov

/* if (!hidden && keyWindow != LGAlertViewHelper.appWindow) { keyWindow.hidden = YES; } */

darling0825 avatar Aug 17 '17 07:08 darling0825

When i have two windows. One with window?.windowLevel = UIWindowLevelNormal, other with UIWindowLevelNormal - 1. After

if (!hidden && keyWindow != LGAlertViewHelper.appWindow) {
        keyWindow.hidden = YES;
}

the screen becomes black. So i want to ask why is this necessary to hide a key window?

After some ivestigation this feature was added in https://github.com/Friend-LGA/LGAlertView/commit/d99e2ec97c5ffa5b07a7f0ee08861d8187fa447d So if you have the same bug, you can use 2.3.0 version, it works well.

Fun stars count has this repo now =) 2017-11-23 21 48 13

NikKovIos avatar Nov 23 '17 16:11 NikKovIos

IIRC it needs to work properly together with other alert views. For example if you occasionally get some system alert view while showing LGAlertView. You can check Alerts Cycle and Mix of Alerts options in demo project. If you have another ideas for workaround, it will be good to have it.

Please, attach some demo project with the reproducible issue. If I have time, I will take a look.

Friend-LGA avatar Mar 27 '18 08:03 Friend-LGA

UIAlertController doesn't use separate window for presentation so hiding of key window doesn't resolve issues you mentioned.

RishatShamsutdinov avatar Mar 28 '18 08:03 RishatShamsutdinov

Also this line is causing a black screen appear (window hiding) in iPad.

NikKovIos avatar Apr 08 '19 10:04 NikKovIos