I noticed that trying to access safeAreaInsets
from the active window
causes an infinite run loop.
This issue appeared after updating to Beta 3.
Here’s an example of the code:
extension UIDevice {
var safeAreaInsets: UIEdgeInsets {
guard let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
let window = windowScene.windows.first(where: { $0.isKeyWindow }) else {
return .zero
}
return window.safeAreaInsets
}
}
The return doesn’t happen because it ends up in some kind of recursion.