IOS11 custom pop-up window does not show/HUD does not disappear problem solution, ios11hud
Solution to the problem that iOS11 custom pop-up window does not display/HUD does not disappear. Recently, an old project running has encountered iOS11 compatibility problems, and iOS10 and earlier versions are normal, in iOS 11 alone, a variety of pop-up windows do not show, or do not disappear. I looked at the source code and found that it was my pot.
Before iOS10
[[[UIApplication sharedApplication] windows]. lastObject addSubview: myaleView];
Yes.ApplicationThe last object in windows can always find the currentWindow.
The reason why iOS 11 is incompatible is that the current method cannot be found.Window,KeyWindow is no longer a question
[[UIApplication sharedApplication]. keyWindow addSubview: myaleView];
In short, command + f or search for the entire project[[[UIApplication sharedApplication] windows]. lastObject addSubview:Change findReplace. Replace all[[UIApplication sharedApplication]. keyWindow addSubview: OK.