Latest 1.0.9
Homepage https://github.com/simaier/iPhonesModel
License MIT
Platforms ios 9.0, requires ARC
Authors

前言

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

我写成了面向协议编程的方式,项目中直接调用协议方法即可

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

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

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

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

  1. Add a pod entry for iPhonesModel to your Podfile
    pod 'iPhonesModel'
  2. Install the pod(s) by running
    pod install
  3. Include iPhonesModelonce you need it with
    import iPhonesModel
  4. Include iPhoneModelS once you need it with

    
    class ViewController: UIViewController,iPhoneModelS {
    
    override func viewDidLoad() {
        super.viewDidLoad()
    
        if iPhone() == .iPhone4
        {
            print("我是iPhone4")
        }else if iPhone() == .iPhoneX
        {
            print("我是iphonex")
        }else
        {
            print("我是iphone")
        }
    }

}


## Example

if iPhone() == .iPhone4
{
print("我是iPhone4")
}

Latest podspec

{
    "name": "iPhonesModel",
    "version": "1.0.9",
    "summary": "Through the way of protocol to judge the model.",
    "homepage": "https://github.com/simaier/iPhonesModel",
    "license": "MIT",
    "authors": {
        "SiMaiEr": "[email protected]"
    },
    "source": {
        "git": "https://github.com/simaier/iPhonesModel.git",
        "tag": "1.0.9"
    },
    "requires_arc": true,
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "iModel/UIDevice_Extension.swift",
    "swift_version": "4.0"
}

Pin It on Pinterest

Share This