UIDevice-SupportedDevices 1.0.3

UIDevice-SupportedDevices 1.0.3

测试已测试
语言 Obj-CObjective C
许可证 MIT
发布最新发布2014年12月

Arthur Ariel Sabintsev 维护。



  • Arthur Ariel Sabintsev

UIDevice+SupportedDevices

注意

由于 Apple 停止更新 iTunes Lookup API 路由中的 supportedKeys 哈希表,我将不再支持此附加组件。

关于

UIDevice 上的一个 Objective-C 分类,根据iTunes Lookup API 调用返回的 JSON 结果中的 supportedDevices 键返回设备。

变更日志(v1.0.3)

  • 开发已停止。

安装说明

pod 'UIDevice-SupportedDevices'

或简单地将 UIDevice+SupportedDevices [.h|.m] 添加到您的项目中,并在需要访问所提供信息的类中引用 UIDevice+SupportedDevices.h

方法

此类中只有一个类方法。请注意,以下描述中提到的“受支持设备名称”一词是指iTunes Lookup API 调用返回的 JSON 结果中的 supportedDevices 键中的值。

点击此处查看一个示例,以亲身了解 supportedDevices 键返回的内容。

  • + (NSString *)machineName
    • 返回 Apple 指定的设备硬件名称
      • 例如,iPad3,1 代表只有 WiFi 的 iPad 3
      • 例如,iPhone5,3 代表只有 GSM 的 iPhone 5c
  • + (NSString *)simulatorNamePhone
    • 返回 iPhone 模拟器
  • + (NSString *)simulatorNamePad
    • 返回 iPad 模拟器
  • + (NSString *)supportedDeviceName
    • 返回当前设备的受支持设备名称
      • 例如,iPad3,1 返回 iPadThirdGen
      • 例如,iPhone5,3 返回 iPhone5c

重要说明

请注意以下细节:

  • 第四代 iPod 存储为 iPodTouchourthGen,第四的 F 字母消失。
  • iPhone 6 和 6+ 在 supportedDevices 键中没有指定,因此我使用与 iPhone 5s 相同的指定,因为它是其类别中最新的具有指定的设备。
  • IPad Mini 2 在 supportedDevices 键中没有指定,因此我使用与 iPad Mini 1 相同的指定,因为它是其类别中最新的具有指定的设备。
  • 第一代iPad Air在supportedDevices键中没有指定,因此我使用与第四代iPad相同的指定,因为它是其类别中最新且具有指定的设备。

灵感

该类别的诞生源于编号35的 Harpy 仓库的问题。构建此类别的底层概念和研究部分来自Aaron Brager

创建和维护

Arthur Ariel Sabintsev