I've been searching a while about this and I've found out that this can't be get from UIDevice.current.model
, because it returns just iPhone
. there were several answers pointing to this code:
if let simulatorModelIdentifier = ProcessInfo().environment["SIMULATOR_MODEL_IDENTIFIER"] {
return simulatorModelIdentifier
}
var sysinfo = utsname()
uname(&sysinfo) // ignore return value
let deviceModel = String(bytes: Data(bytes: &sysinfo.machine, count: Int(_SYS_NAMELEN)), encoding: .ascii)?.trimmingCharacters(in: .controlCharacters)
return deviceModel ?? ""
by the way I'm not sure that this uses public or private api and it seems like private api for me.
Question is this code using any private api?