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
Size: 57
Language: Swift
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Super-lightweight library to detect used device
Device.swift
extends the UIDevice
class by adding a property:
deviceType: DeviceType
Add the following to your Cartfile
and follow these instructions
ub "schickling/Device.swift"
To integrate Device
into your project add the following to your Podfile
:
form :ios, '8.0'
frameworks!
'Device.swift'
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