Use DeviceModel
to get some usefull information about some Apple devices (specially iPhones and iPads).
Currently the Mac models available in this library correspond only to those that use Apple Silicon chips
Support for iOS, iPadOS, macOS and tvOS
For Swift 4 please use v1
For Swift 5 please use v2+
Add the package using Xcode or copy this into your Package.swift
file:
.package(url: "https://github.com/hyperdevs-team/DeviceIdentificator", from: "4.0.0")
To install it manually, drag the DeviceIdentificator folder into your app project in Xcode. You can also add it as a git submodule by running the following command:
$ git submodule add https://github.com/hyperdevs-team/DeviceIdentificator.git
import DeviceIdentificator
let deviceModel = DeviceModel.current
print("Current device: \(deviceModel.name)")
let isIpad = deviceModel.isIpad
let isSimulator = deviceModel.isSimulator