Skip to content

UIDevice extension to fetch current device info such commercial name (iPhone X instead of iPhone10,3).

License

Notifications You must be signed in to change notification settings

sebastianvarela/DeviceIdentificator

Repository files navigation

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;

About

UIDevice extension to fetch current device info such commercial name (iPhone X instead of iPhone10,3).

Resources

License

Stars

Watchers

Forks

Packages

No packages published