问题描述:使用 [UIApplication sharedApplication].windows.firstObject 获取keywindow 在 ios 15 报警告:
'windows' is deprecated: first deprecated in iOS 15.0 - Use UIWindowScene.windows on a relevant window scene instead
解决方案:来自Framework Engineer
If you have a view, the easiest way to access the key window of your scene is to call view.window.windowScene.keyWindow
直接使用:self.view.window.windowScene.keyWindow