Avatar ·

How to determine the model of the current iPhone or iOS device in Swift?

Hi everyone! I'm developing an iOS app in Swift and I've encountered a task: I need to programmatically determine which specific device the app is running on. For example, I want to know if the app is running on an iPhone 14 Pro Max, iPhone SE (3rd generation), or an iPad Air. The problem is that I can't find a reliable way to get the model name string. I tried using `UIDevice.current.model`, but it only returns the general type — "iPhone", "iPad", or "iPod touch". I need the exact model, like "iPhone13,4" or "iPhone15,3". Here's what I've tried: ```swift let device = UIDevice.current print(device.model) // Prints just "iPhone" print(device.localizedModel) // Also "iPhone" ``` I've heard that you can use `sysctl` or read some system