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

相关文章

Spring Security 从入门到进阶系列教程

Spring Security 入门系列 《保护 Web 应用的安全》 《Spring-Security-入门(一):登录与退出》 《Spring-Security-入门(二):基于数据库验证》 《Spring-Security-入门(三):密码加密》 《Spring-Security-入门(四):自定义-Filter》 《Spring-Security-入门(五):在 Sprin

安卓链接正常显示,ios#符被转义%23导致链接访问404

原因分析: url中含有特殊字符 中文未编码 都有可能导致URL转换失败,所以需要对url编码处理  如下: guard let allowUrl = webUrl.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) else {return} 后面发现当url中有#号时,会被误伤转义为%23,导致链接无法访问

科研绘图系列:R语言扩展物种堆积图(Extended Stacked Barplot)

介绍 R语言的扩展物种堆积图是一种数据可视化工具,它不仅展示了物种的堆积结果,还整合了不同样本分组之间的差异性分析结果。这种图形表示方法能够直观地比较不同物种在各个分组中的显著性差异,为研究者提供了一种有效的数据解读方式。 加载R包 knitr::opts_chunk$set(warning = F, message = F)library(tidyverse)library(phyl

【生成模型系列(初级)】嵌入(Embedding)方程——自然语言处理的数学灵魂【通俗理解】

【通俗理解】嵌入(Embedding)方程——自然语言处理的数学灵魂 关键词提炼 #嵌入方程 #自然语言处理 #词向量 #机器学习 #神经网络 #向量空间模型 #Siri #Google翻译 #AlexNet 第一节:嵌入方程的类比与核心概念【尽可能通俗】 嵌入方程可以被看作是自然语言处理中的“翻译机”,它将文本中的单词或短语转换成计算机能够理解的数学形式,即向量。 正如翻译机将一种语言

flume系列之:查看flume系统日志、查看统计flume日志类型、查看flume日志

遍历指定目录下多个文件查找指定内容 服务器系统日志会记录flume相关日志 cat /var/log/messages |grep -i oom 查找系统日志中关于flume的指定日志 import osdef search_string_in_files(directory, search_string):count = 0

【iOS】MVC模式

MVC模式 MVC模式MVC模式demo MVC模式 MVC模式全称为model(模型)view(视图)controller(控制器),他分为三个不同的层分别负责不同的职责。 View:该层用于存放视图,该层中我们可以对页面及控件进行布局。Model:模型一般都拥有很好的可复用性,在该层中,我们可以统一管理一些数据。Controlller:该层充当一个CPU的功能,即该应用程序

Android Environment 获取的路径问题

1. 以获取 /System 路径为例 /*** Return root of the "system" partition holding the core Android OS.* Always present and mounted read-only.*/public static @NonNull File getRootDirectory() {return DIR_ANDR

cell phone teardown 手机拆卸

tweezer 镊子 screwdriver 螺丝刀 opening tool 开口工具 repair 修理 battery 电池 rear panel 后盖 front and rear cameras 前后摄像头 volume button board 音量键线路板 headphone jack 耳机孔 a cracked screen 破裂屏 otherwise non-functiona

GPT系列之:GPT-1,GPT-2,GPT-3详细解读

一、GPT1 论文:Improving Language Understanding by Generative Pre-Training 链接:https://cdn.openai.com/research-covers/languageunsupervised/language_understanding_paper.pdf 启发点:生成loss和微调loss同时作用,让下游任务来适应预训

Java基础回顾系列-第七天-高级编程之IO

Java基础回顾系列-第七天-高级编程之IO 文件操作字节流与字符流OutputStream字节输出流FileOutputStream InputStream字节输入流FileInputStream Writer字符输出流FileWriter Reader字符输入流字节流与字符流的区别转换流InputStreamReaderOutputStreamWriter 文件复制 字符编码内存操作流(