duckduckgo/Device.swift

Name: Device.swift

Owner: DuckDuckGo

Description: Super-lightweight library to detect used device

Forked from: schickling/Device.swift

Created: 2018-01-26 12:43:53.0

Updated: 2018-04-18 17:55:47.0

Pushed: 2018-04-18 17:57:27.0

Homepage:

Size: 57

Language: Swift

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Device.swift

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:

deviceType: DeviceType
Install
Carthage

Add the following to your Cartfile and follow these instructions

ub "schickling/Device.swift"
CocoaPods

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

form :ios, '8.0'
frameworks!

'Device.swift'
Usage
rt Device
se import Device_swift if you're using Cocoapods

deviceType = UIDevice.current.deviceType

ch deviceType {
 .iPhone6SPlus: print("Do stuff for iPhone6S Plus")
 .iPadMini: print("Do stuff for iPad mini")
ult: print("Check other available cases of DeviceType")

Also, check out our Documentation


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.