Latest 0.2.0
Homepage https://github.com/Zaakk/DeviceDetector
License MIT
Platforms ios 9.0, watchos 2.0, tvos 9.0
Authors

DeviceDetector able to detect device’s model and cellular type.

Supported devices:

  1. iPhone
  2. iPad
  3. AppleTV
  4. Apple Watch

Usage

Import module

import DeviceDetector

And then you can check current device directly in condition or switch-case

if DeviceDetector.device.is(iPadModel.Model2(cellularType: .CDMA))
{
  print("is iPad2")
}

if DeviceDetector.device.younger(iPhoneModel.Model3G(cellularType: .CDMA))
{
  print("Current device is younger than iPhone 3G")
}

if case iPhoneModel.Model3G(cellularType: let cellular) = DeviceDetector.device, cellular == .GSM
{
    print("The device is iPhone 3G AND GSM")
}

Installation

DeviceDetector is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'DeviceDetector'

Alternatively, copy DeviceDetector folder . If you use this method, you can omit the line "import DeviceDetector" at the head of your file.

Author

Alexander Zakatnov, [email protected]

License

DeviceDetector is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "DeviceDetector",
    "version": "0.2.0",
    "summary": "DeviceDetector lib for device's model detecting on Swift",
    "description": "DeviceDetecor library able to detect and compare the device model",
    "homepage": "https://github.com/Zaakk/DeviceDetector",
    "license": "MIT",
    "authors": {
        "Zaakk": "[email protected]"
    },
    "platforms": {
        "ios": "9.0",
        "watchos": "2.0",
        "tvos": "9.0"
    },
    "source": {
        "git": "https://github.com/Zaakk/DeviceDetector.git",
        "tag": "0.2.0"
    },
    "source_files": "DeviceDetector/**/*.{h,m,swift}",
    "swift_version": "4.2"
}

Pin It on Pinterest

Share This