Starting with the Mac Studio, and continuing with the 2022 and 2023 MacBook Air/Pro, Mac mini, Mac Studio, and Mac Pro, Macs no longer have identifying model names like
iMac14,2. Instead, they’re now something like
Mac14,9. Using a simple prefix check to figure out which “class” of Mac the app is running on no longer works.
As a new solution, you can query UniformTypeIdentifiers, which holds a comprehensive taxonomy of all PowerPC, Intel, and Apple Silicon Macs released up to the point of the running macOS version. The upside is also that you can find tons of other information on the device, such as the visual design, which works great for picking the right SF Symbol.
Here is the result of the below code on my 14″ MacBook Pro with M2 Pro:
Really unfortunately, nothing similar seems to exist on iOS. It would have been great to have this considering we now have three major hardware designs (home bar, home button, dynamic island) to worry about.