用于获取 Apple 设备型号名称的 Swift 微型库。
从 Apple 设备获取市场营销名称,例如 “iPhone 13 mini”。
CocoaPods 要使用 CocoaPods 将 RNDeviceName 集成到您的 Xcode 项目中,请在您的 Podfile
中指定它
pod 'RNDeviceName'
Swift Package Manager 一旦您设置好 Swift 包管理器,
RNDeviceName
添加到您的 Package.swift
的 dependencies
值中。dependencies: [
.package(url: "https://github.com/souzainf3/RNDeviceName.git", .upToNextMajor(from: "1.1.0")) // set you tag or branch
]
Sources
文件夹拖到您的项目中UIDevice.current.marketingName // such as `iPhone 13 mini`
Device.current.marketingName // such as `iPhone 13 mini`
设备型号列表,需要使用 SQLite 查看 traits 数据库
在线 SQLite 查看器 https://inloop.github.io/sqlite-viewer/```
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/usr/standalone/device_traits.db
/Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/usr/standalone/device_traits.db
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/usr/standalone/device_traits.db