Latest 0.0.4
Homepage https://github.com/seasonZhu/UIDevice-Hardware
Platforms ios 9.0
Authors

UIDevice-Hardware

前言

Swift UIDevice分类 用于判断手机型号等硬件功能

代码参考了OC版本的UIDeviceIdentifier

使用UIDevice的分类使得代码逻辑与结构更为简单,另外语言风格更加Swift化

这算是第一次将自己写的东西在pods实战吧,吃了点亏

对public属性不是了解,结果方法都是对模块内的,导致就算import引用了,也无法调用其方法,于是更新了好几次,打了好几次tag.也算是一直收获吧

Adding UIDeviceHardware to your project (添加 UIDeviceHardware 到你的项目)

CocoaPods is the recommended way to add UIDeviceHardware to your project.

  1. Add a pod entry for UIDeviceHardware to your Podfile
    pod 'UIDeviceHardware'
  2. Install the pod(s) by running
    pod install
  3. Include UIDeviceHardwareonce you need it with
    import UIDeviceHardware

Example

if UIDevice.deviceType == UIDevice.Info.iPhone8 {
            print("it is iPhone8")
 }

Latest podspec

{
    "name": "UIDeviceHardware",
    "version": "0.0.4",
    "summary": "A UIDevice Extension For Hardware",
    "description": "A UIDevice Extension For Hardware",
    "homepage": "https://github.com/seasonZhu/UIDevice-Hardware",
    "authors": {
        "zhujilong": "[email protected]"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/seasonZhu/UIDevice-Hardware.git",
        "tag": "0.0.4"
    },
    "source_files": "UIDeviceHardware/UIDeviceHardware/UIDevice+Hardware.swift",
    "swift_version": "4.0"
}

Pin It on Pinterest

Share This