Value-type replacement for UIDevice: device model, battery, screen and sensors in Swift
open sourceMITfree
DeviceKit is a Swift library that replaces UIDevice with an equatable value type. It identifies the exact device model and its family and group, detects the simulator, and reads battery state and level, screen size, ratio and pixel density, Low Power Mode, Guided Access, screen brightness, Display Zoom, available sensors such as Touch ID and Face ID, free disk space and Apple Pencil support. It supports iOS, tvOS and watchOS and installs with CocoaPods, Swift Package Manager or Carthage.
Problems it solves
- find out which iPhone model my app is running on
- check whether my iOS app is running in the simulator
- read the battery level and Low Power Mode in Swift
Features
- identifies the exact iPhone, iPad, Apple TV or Apple Watch model
- device family, group and simulator detection
- battery state, battery level and Low Power Mode
- screen size, ratio, PPI, brightness and Display Zoom
- detects Touch ID, Face ID and Apple Pencil support
- available disk space
Limitations
- Needs iOS 11, tvOS 11 or watchOS 4 or newer; older OS versions need an older major release.1
Alternatives
The same job
These do what DeviceKit does.