DeviceIdentificator 3.0.2

DeviceIdentificator 3.0.2

Maintained by Sebastián Varela.



DeviceIdentificator

CocoaPods Compatible Carthage Compatible Platform Platform Build Status codecov codebeat badge

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;