Created
September 2, 2020 19:01
-
-
Save mlavergn/62007521d572ecd7794065fead3b9200 to your computer and use it in GitHub Desktop.
iOS13 Deprecations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// keyWindow | |
- UIApplication.shared.keyWindow | |
+ UIApplication.shared.windows.first { $0.isKeyWindow } | |
// alt via Scenes | |
- UIApplication.shared.keyWindow | |
+ UIApplication.shared.connectedScenes.compactMap { $0 as? UIWindowScene }.flatMap { $0.windows }.first { $0.isKeyWindow } | |
// statusBarFrame | |
- UIApplication.shared.statusBarFrame | |
+ UIApplication.shared.connectedScenes.compactMap { $0 as? UIWindowScene }.first { $0.windows.contains { $0.isKeyWindow } }?.statusBarManager?.statusBarFrame |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment