Latest 0.1.2
License MIT
Platforms ios 8.0

[![CI Status]( Sokolov/DSDeviceKit.svg?style=flat)]( Sokolov/DSDeviceKit)


A wrapper for UIDevice that provides quick access to all necessary information about current Device. Implements the Singleton Pattern


  • ARC
  • iOS 8 (dynamic framework)


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

pod "DSDeviceKit"


import DSDeviceKit

let device = DSDeviceKit.currentDevice

print(device.modelName)     // "iPhone 6s" or "iPad Air 2" and so on
print(device.identifier)    // "iPhone8,1" or "Simulator" and so on
print(device.iOSVersion)    // "9.3" and so on
print(device.deviceType)    // "iPhone" or "iPad" or "iPod Touch" or "Unknown"
print(device.isPhone)       // true or false

let devices = ["iphone 6", "ipad pro", "iPhone SE"]

if device.isOneOf(devices) {
    // is one of the allowed devices

if device.deviceType == .iPodTouch { // or .iPhone or .iPad
    // ...

// or you can use convenient computed variables:

if device.isPhone {
    // this is iPhone

if device.isIPad {
    // this is iPad

Example project

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


Dmitry Sokolov


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

Latest podspec

    "name": "DSDeviceKit",
    "version": "0.1.2",
    "summary": "A wrapper for UIDevice that facilitates access to iOS Device info",
    "description": "This CocoaPod is a wrapper for UIDevice that provides a better way to get information about current device. Written in SwiftnnStatic instance of DSDeviceKit (currentDevice) has many properties, such as:nn- modelName     // "iPhone 6s"n- iOSVersion    // "9.3"n- deviceType    // .iPhone or .iPadn- identifier    // "iPhone8,1"n- isPhone       // true or falsen- isIpad        // true of falsen- orientation   // UIDeviceOrientationn- userInterface // UIUserInterfaceIdiom",
    "homepage": "",
    "screenshots": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Dmitry Sokolov": ""
    "source": {
        "git": "",
        "tag": "0.1.2"
    "platforms": {
        "ios": "8.0"
    "source_files": "DSDeviceKit/Classes/**/*"

Pin It on Pinterest

Share This