Determine if current device has physical home button

Is there a way to determine whether the current device has a physical home button or not?

I am building part of a UI which is very much like the Files app - it has buttons for "iCloud Documents" and "Documents on this device". For the latter, it will use a suitable symbol from SF Symbols i.e. "iphone" or "ipad" (or something for Macs). Just like the Files app.

But I notice that the Files app uses the ".homebutton" symbol variants on older devices that have a physical home button. What is the easiest way to replicate that?

I was considering looking at the "iPhoneNN,M" string and comparing it with the model number of the first devices without a physical button, but that is complicated by e.g. the current iPhone SE, which is "iPhone14,6". I don't want to have to maintain a table.

Is there some easy way to do this?

Thanks.

An indirect way to knwo is to check if there is a notch:

extension UIDevice {
    var hasNotch: Bool {
        if #available(iOS 13.0, *) {
            let scenes = UIApplication.shared.connectedScenes
            let windowScene = scenes.first as? UIWindowScene
            guard let window = windowScene?.windows.first else { return false }
            
            return window.safeAreaInsets.top > 20
        }
        
        if #available(iOS 11.0, *) {
            let top = UIApplication.shared.windows[0].safeAreaInsets.top
            return top > 20
        } else {
            // Fallback on earlier versions
            return false
        }
    }
}

If not, that should mean (at least with present devices) that there is a button (except if ID button in on the side ?)

Thanks Claude. Yes it's a bit indirect; I wonder if it will be more or less reliable than a table of model numbers? Anyway this is the sort of detail that I bet no user will ever even notice, so I'm not going to spend a lot of time on it!

Anyway this is the sort of detail that I bet no user will ever even notice

Yes, that provide just a small additional user value.

.

will be more or less reliable than a table of model numbers?

As you noted, issue with model numbers is new models. And you cannot assume that new models won't have home button (iPhone SE). So no way to tell by default that non listed models are button free.

So I see the computation as more reliable.

Determine if current device has physical home button
 
 
Q