Latest 1.2.2
Homepage https://github.com/schickling/Device.swift
License MIT
Platforms ios 8.0, requires ARC
Frameworks UIKit
Authors , ,

Language
License
Platform
Documentation
Pod Version
Carthage Compatible

Super-lightweight library to detect used device

Device.swift extends the UIDevice class by adding a property:

var deviceType: DeviceType

Install

Carthage

Add the following to your Cartfile and follow these instructions

github "schickling/Device.swift"

CocoaPods

To integrate Device into your project add the following to your Podfile:

platform :ios, '8.0'
use_frameworks!

pod 'Device.swift'

Usage

import Device

// Use import Device_swift if you're using Cocoapods

let deviceType = UIDevice.current.deviceType

switch deviceType {
  case .iPhone6SPlus: print("Do stuff for iPhone6S Plus")
  case .iPadMini: print("Do stuff for iPad mini")
  default: print("Check other available cases of DeviceType")
}

How to make release

  • Update pod version in podspec
  • Add tag
  • Add validate pod pod trunk push Device.swift.podspec --allow-warnings
  • Push to CocoaPods
  • Create release in github for with attached file for carthage
carthage build --no-skip-current
carthage archive Device

Also, check out our Documentation

Latest podspec

{
    "name": "Device.swift",
    "version": "1.2.2",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "summary": "Super-lightweight library to detect used device",
    "homepage": "https://github.com/schickling/Device.swift",
    "source": {
        "git": "https://github.com/schickling/Device.swift.git",
        "tag": "1.2.2"
    },
    "source_files": "Device/**/*.{swift}",
    "platforms": {
        "ios": "8.0"
    },
    "frameworks": "UIKit",
    "requires_arc": true,
    "swift_version": "4.2",
    "authors": {
        "Johannes Schickling": "[email protected]",
        "Cody Winton": "[email protected]",
        "Igor Kislyuk": "[email protected]"
    }
}

Pin It on Pinterest

Share This