pmusolino / Wormholy

iOS network debugging, like a wizard 🧙‍♂️
MIT License
2.31k stars 184 forks source link

fix: `keyWindow` deprecation warning #120

Closed gmoraleda closed 1 year ago

gmoraleda commented 1 year ago

The current method to select the rootViewController from the key window was deprecated as of iOS 13. This PR uses the non-deprecated approach.

pmusolino commented 1 year ago

Hello there. Did you test this also on previous version of iOS (like iOS 15/14)?

gmoraleda commented 1 year ago

Hello there. Did you test this also on previous version of iOS (like iOS 15/14)?

Yes, we are currently using it on an app targeting iOS 14. The windows property was introduced in iOS 2 I believe.

gmoraleda commented 1 year ago

A long term migration will be stepping out of UIApplication.shared.windows and adopt UISeceneDelegate, tho.