DeviceIdentificator
Introduction
UIDevice extension to fetch current device info such commercial name (iPhone X instead of iPhone10,3).
Platforms
Support for iOS and tvOS
Support
For Swift 4 please use v1
For Swift 5 please use v2+
Installation
This framework is compatible with Carthage or Cocoapods, use one of both.
Carthage
Add this into your Cartfile
:
github "sebastianvarela/DeviceIdentificator"
Cocoapods
Add this into your Podfile
:
pod 'DeviceIdentificator'
Usage
Swift:
let deviceModel = UIDevice.current.deviceModel
print("Current device: \(deviceModel.name)")
let isIpad = UIDevice.current.isIpad
let isSimulator = UIDevice.current.isSimulator
Objective-C:
NSString *deviceModelName = [UIDevice currentDevice].deviceModelName;
NSLog(@"Current device: %@", [UIDevice currentDevice].deviceModelName);
BOOL isIpad = [UIDevice currentDevice].isIpad;
BOOL isSimulator = [UIDevice currentDevice].isSimulator;