iOS 26 Beta 3 `safeAreaInsets`

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.

Beta 3 of what? iOS, iPadOS, Xcode?

I can't reproduce this on Xcode 26 beta 3 with iOS 26 beta 3, or Xcode 26 beta 3 with iOS 18.5.

Do we need more code than you've given, maybe?

The issue is with iOS 26 on a project built with Xcode 16.4. I’m encountering a recursion loop specifically when trying to use the safeArea value — for example, for bottom padding .padding(.bottom, max(16, UIDevice.current.safeAreaInsets.bottom))

However, when I move a simplified version of the view into a test project, the problem disappears. So I’ll continue investigating what exactly is triggering the recursion in this specific case. I’ll also try building the project with xCode 26. It’s weird because everything was working fine on iOS26 Beta 2, and these weird freezes only started after updating the phone to Beta 3. Thanks for getting back to me!

iOS 26 Beta 3 `safeAreaInsets`
 
 
Q