UIDevice extension to fetch current device info such commercial name (iPhone X instead of iPhone10,3).
Support for iOS and tvOS
For Swift 4 please use v1
For Swift 5 please use v2+
This framework is compatible with Carthage or Cocoapods, use one of both.
Add this into your Cartfile
:
github "sebastianvarela/DeviceIdentificator"
Add this into your Podfile
:
pod 'DeviceIdentificator'
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;