Skip to content

Welltory/DeviceUtil

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DeviceUtil

Please use DeviceGuru Library, it is its swift version and also has some extra feature. Use it as below

pod 'DeviceGuru'

DeviceUtil helps identifying the exact harware type of the device. e.g. iPhone 6 or iPhone 6s.

  • Easy to use
  • Light weight

From version 4.0.2 it can also identify the simulator type, whether it's iPhone XR or iPhone 6

Installation

Go to https://cocoapods.org
Search for DeviceUtil lib
Copy the pod dependency and add that to your pod file. e.g.

pod 'DeviceUtil'

Usage

DeviceUtil *deviceUtil = [[DeviceUtil alloc] init];
if ([deviceUtil hardware] == IPHONE_5C) {
NSLog(@"Device is iPhone 5c");
}

Development

Want to contribute? Great! Just update the GeneratorDevice.plist

Then

cd Generator
./main.swift

The above command will auto generate the required code

Send the pull request 🚀

License

MIT

Packages

No packages published

Languages

  • Objective-C 61.9%
  • C 19.9%
  • Swift 16.1%
  • Ruby 2.1%