In iOS9.1, When I remove a custom UIWindow by removeFromSuperView and set to nil, it did't disappear automatically until click on the window. and show error with
unexpected nil window in _UIApplicationHandleEventFromQueueEvent, _windowServerHitTestWindow: (null)
When in iOS9 and lower,it will works fine.
UIWindow *window = [target associatedValueForKey:lock_window];
if (window) [window removeFromSuperview];
[target associateValue:nil withKey:lock_window];
I has solved the problem with code
UIWindow *window = [target associatedValueForKey:lock_window];
if (window) [window removeFromSuperview];
window.hidden = YES;
[target associateValue:nil withKey:lock_window];
the - (void)makeKeyAndVisible method annotation is
convenience. most apps call this to show the main window and also make it key. otherwise use view hidden property
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With