Latest 1.0.2
Homepage https://github.com/legranddamien/SwiftyDevice
License MIT
Platforms ios 9.0

Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Tested on:

  • Xcode 9
  • Swift 4.1

Installation

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

pod 'SwiftyDevice'

Usage

To use SwiftyDevice import it :

import SwiftyDevice

And in the code :

/// Get information about the current device

let device = Device.currentDevice

print("Device family name : (device.family.rawValue)") // Device family name : iPad Pro 10.5" (Wi-Fi)
print("Device release date : (device.releaseDate)") // Device release date : 06/05/2017

/// Or get information about another device with the codename

let otherDevice = Device.device(with: "iPhone9,4") // otherDevice.family == DeviceFamily.iPhone7Plus

See the list of supported devices : Supported Devices

Development

The Devices.plist, DeviceFamily.swift and Devices.md files are generated automatically from another target in the project, HardwareParser.
To add new devices in the project, simply run the HardwareParser scheme on the mac, and the two files will be updated with the data from www.everymac.com.

Author

Damien Legrand

License

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

Latest podspec

{
    "name": "SwiftyDevice",
    "version": "1.0.2",
    "summary": "Swift library to help you know the current used device.",
    "description": "SwiftyDevice is a swift library to know the type of device. So you'll easily get the name of the device and it's release date.",
    "homepage": "https://github.com/legranddamien/SwiftyDevice",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": "Damien Legrand",
    "source": {
        "git": "https://github.com/legranddamien/SwiftyDevice.git",
        "tag": "1.0.2"
    },
    "social_media_url": "https://twitter.com/damien_legrand",
    "platforms": {
        "ios": "9.0"
    },
    "swift_version": "4.2",
    "source_files": "SwiftyDevice/Classes/**/*.swift",
    "resource_bundles": {
        "SwiftyDevice": [
            "SwiftyDevice/Assets/**/*.plist"
        ]
    }
}

Pin It on Pinterest

Share This