iOS获取手机型号(包含iOS15系列)

2023-12-27 06:20

本文主要是介绍iOS获取手机型号(包含iOS15系列),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

 

swift 获取设备型号

获取手机系统型号 https://www.theiphonewiki.com/wiki/Models

获取最新型号查询地址 https://everymac.com

iPod系列:https://everymac.com/systems/apple/ipod/index-ipod-specs.html

iPad系列:https://everymac.com/systems/apple/ipad/index-ipad-specs.html

iPhone系列:https://everymac.com/systems/apple/iphone/index-iphone-specs.html

 
public extension UIDevice {var phoneModel: String {var systemInfo = utsname()uname(&systemInfo)let machineMirror = Mirror(reflecting: systemInfo.machine)let identifier = machineMirror.children.reduce("") { identifier, element inguard let value = element.value as? Int8 , value != 0 else { return identifier }return identifier + String(UnicodeScalar(UInt8(value)))}switch identifier {case "iPod5,1":                                 return "iPod Touch 5"case "iPod7,1":                                 return "iPod Touch 6"case "iPhone3,1", "iPhone3,2", "iPhone3,3":     return "iPhone 4"case "iPhone4,1":                               return "iPhone 4s"case "iPhone5,1", "iPhone5,2":                  return "iPhone 5"case "iPhone5,3", "iPhone5,4":                  return "iPhone 5c"case "iPhone6,1", "iPhone6,2":                  return "iPhone 5s"case "iPhone7,2":                               return "iPhone 6"case "iPhone7,1":                               return "iPhone 6 Plus"case "iPhone8,1":                               return "iPhone 6s"case "iPhone8,2":                               return "iPhone 6s Plus"case "iPhone8,4":                               return "iPhone SE (1st generation)"case "iPhone9,1", "iPhone9,3":                  return "iPhone 7"case "iPhone9,2", "iPhone9,4":                  return "iPhone 7 Plus"case "iPhone10,1", "iPhone10,4":                return "iPhone 8"case "iPhone10,5", "iPhone10,2":                return "iPhone 8 Plus"case "iPhone10,3", "iPhone10,6":                return "iPhone X"case "iPhone11,2":                              return "iPhone XS"case "iPhone11,4", "iPhone11,6":                return "iPhone XS MAX"case "iPhone11,8":                              return "iPhone XR"case "iPhone12,1":                              return "iPhone 11"case "iPhone12,3":                              return "iPhone 11 pro"case "iPhone12,5":                              return "iPhone 11 Pro Max"case "iPhone12,8":                              return "iPhone SE (2nd generation)"case "iPhone13,1":                              return "iPhone 12 mini"case "iPhone13,2":                              return "iPhone 12"case "iPhone13,3":                              return "iPhone 12 Pro"case "iPhone13,4":                              return "iPhone 12 Pro Max"case "iPhone14,4":                              return "iPhone 13 mini"case "iPhone14,5":                              return "iPhone 13"case "iPhone14,2":                              return "iPhone 13 Pro"case "iPhone14,3":                              return "iPhone 13 Pro Max"case "iPhone14,6":                              return "iPhone SE (3rd generation)"case "iPhone14,7":                              return "iPhone 14"case "iPhone14,8":                              return "iPhone 14 Plus"case "iPhone15,2":                              return "iPhone 14 Pro"case "iPhone15,3":                              return "iPhone 14 Pro Max"case "iPhone15,4":                              return "iPhone 15"case "iPhone15,5":                              return "iPhone 15 Plus"case "iPhone16,1":                              return "iPhone 15 Pro"case "iPhone16,2":                              return "iPhone 15 Pro Max"case "iPad2,1", "iPad2,2", "iPad2,3", "iPad2,4":return "iPad 2"case "iPad3,1", "iPad3,2", "iPad3,3":           return "iPad 3"case "iPad3,4", "iPad3,5", "iPad3,6":           return "iPad 4"case "iPad6,11", "iPad6,12":                    return "iPad 5"case "iPad7,5", "iPad7,6":                      return "iPad 6"case "iPad7,11", "iPad7,12":                    return "iPad 7"case "iPad11,6", "iPad11,7":                    return "iPad 8"case "iPad12,1", "iPad12,2":                    return "iPad 9"case "iPad4,1", "iPad4,2", "iPad4,3":           return "iPad Air"case "iPad5,3", "iPad5,4":                      return "iPad Air 2"case "iPad11,3", "iPad11,4":                    return "iPad Air 3"case "iPad13,1", "iPad13,2":                    return "iPad Air 4"case "iPad13,16", "iPad13,17":                  return "iPad Air 5"case "iPad2,5", "iPad2,6", "iPad2,7":           return "iPad Mini"case "iPad4,4", "iPad4,5", "iPad4,6":           return "iPad Mini 2"case "iPad4,7", "iPad4,8", "iPad4,9":           return "iPad Mini 3"case "iPad5,1", "iPad5,2":                      return "iPad Mini 4"case "iPad11,1", "iPad11,2":                    return "iPad Mini 5"case "iPad14,1", "iPad14,2":                    return "iPad Mini 6"case "iPad6,7", "iPad6,8", "iPad6,3", "iPad6,4", "iPad7,1", "iPad7,2", "iPad7,3", "iPad7,4", "iPad8,1", "iPad8,2", "iPad8,3", "iPad8,4", "iPad8,5", "iPad8,6", "iPad8,7", "iPad8,8", "iPad8,9", "iPad8,10", "iPad8,11", "iPad8,12":         return "iPad Pro"case "AppleTV5,3":                              return "Apple TV"case "i386", "x86_64":                          return "Simulator"default:                                        return identifier}}}

这篇关于iOS获取手机型号(包含iOS15系列)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/542147

相关文章

python获取网页表格的多种方法汇总

《python获取网页表格的多种方法汇总》我们在网页上看到很多的表格,如果要获取里面的数据或者转化成其他格式,就需要将表格获取下来并进行整理,在Python中,获取网页表格的方法有多种,下面就跟随小编... 目录1. 使用Pandas的read_html2. 使用BeautifulSoup和pandas3.

SpringBoot UserAgentUtils获取用户浏览器的用法

《SpringBootUserAgentUtils获取用户浏览器的用法》UserAgentUtils是于处理用户代理(User-Agent)字符串的工具类,一般用于解析和处理浏览器、操作系统以及设备... 目录介绍效果图依赖封装客户端工具封装IP工具实体类获取设备信息入库介绍UserAgentUtils

C# foreach 循环中获取索引的实现方式

《C#foreach循环中获取索引的实现方式》:本文主要介绍C#foreach循环中获取索引的实现方式,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下吧... 目录一、手动维护索引变量二、LINQ Select + 元组解构三、扩展方法封装索引四、使用 for 循环替代

Android实现两台手机屏幕共享和远程控制功能

《Android实现两台手机屏幕共享和远程控制功能》在远程协助、在线教学、技术支持等多种场景下,实时获得另一部移动设备的屏幕画面,并对其进行操作,具有极高的应用价值,本项目旨在实现两台Android手... 目录一、项目概述二、相关知识2.1 MediaProjection API2.2 Socket 网络

Linux下如何使用C++获取硬件信息

《Linux下如何使用C++获取硬件信息》这篇文章主要为大家详细介绍了如何使用C++实现获取CPU,主板,磁盘,BIOS信息等硬件信息,文中的示例代码讲解详细,感兴趣的小伙伴可以了解下... 目录方法获取CPU信息:读取"/proc/cpuinfo"文件获取磁盘信息:读取"/proc/diskstats"文

Vue3组件中getCurrentInstance()获取App实例,但是返回null的解决方案

《Vue3组件中getCurrentInstance()获取App实例,但是返回null的解决方案》:本文主要介绍Vue3组件中getCurrentInstance()获取App实例,但是返回nu... 目录vue3组件中getCurrentInstajavascriptnce()获取App实例,但是返回n

SpringMVC获取请求参数的方法

《SpringMVC获取请求参数的方法》:本文主要介绍SpringMVC获取请求参数的方法,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下... 目录1、通过ServletAPI获取2、通过控制器方法的形参获取请求参数3、@RequestParam4、@

使用Python实现全能手机虚拟键盘的示例代码

《使用Python实现全能手机虚拟键盘的示例代码》在数字化办公时代,你是否遇到过这样的场景:会议室投影电脑突然键盘失灵、躺在沙发上想远程控制书房电脑、或者需要给长辈远程协助操作?今天我要分享的Pyth... 目录一、项目概述:不止于键盘的远程控制方案1.1 创新价值1.2 技术栈全景二、需求实现步骤一、需求

Python获取C++中返回的char*字段的两种思路

《Python获取C++中返回的char*字段的两种思路》有时候需要获取C++函数中返回来的不定长的char*字符串,本文小编为大家找到了两种解决问题的思路,感兴趣的小伙伴可以跟随小编一起学习一下... 有时候需要获取C++函数中返回来的不定长的char*字符串,目前我找到两种解决问题的思路,具体实现如下:

golang获取当前时间、时间戳和时间字符串及它们之间的相互转换方法

《golang获取当前时间、时间戳和时间字符串及它们之间的相互转换方法》:本文主要介绍golang获取当前时间、时间戳和时间字符串及它们之间的相互转换,本文通过实例代码给大家介绍的非常详细,感兴趣... 目录1、获取当前时间2、获取当前时间戳3、获取当前时间的字符串格式4、它们之间的相互转化上篇文章给大家介