I'm currently using the extension below to determine whether an iPhone has a notch so I can adjust my UI accordingly.
extension UIDevice {
var hasNotch: Bool {
if userInterfaceIdiom == .phone, let window = (UIApplication.shared.connectedScenes
.compactMap { $0 as? UIWindowScene }
.flatMap { $0.windows }
.first { $0.isKeyWindow }) {
return window.safeAreaInsets.bottom > 0
}
return false
}
}
(Adapted from https://stackoverflow.com/questions/73946911/how-to-detect-users-device-has-dynamic-island-in-uikit)
This no longer works in iOS 26, and I have yet to find a similar method that works. Does anyone have any fixes?