Enable or disable app features based on whether the user's device has Face ID or Touch ID.
Show device-specific UI adjustments for notched iPhones versus older flat-screen models.
Check if the app is running in the Xcode Simulator to skip hardware-only code paths during testing.
Read battery percentage and Low Power Mode status to pause background sync and save battery.
Add via Swift Package Manager or CocoaPods, no external services or configuration needed.
DeviceKit is a Swift library for iOS, tvOS, and watchOS developers that makes it easy to identify what Apple device an app is running on and to read information about that device. It is a drop-in replacement for UIDevice, which is Apple's own built-in way of getting device information but has a less convenient API. The library lets you ask questions like: what exact iPhone model is this, is it a phone or a tablet, is it running in the iOS Simulator (the test environment Xcode uses on a Mac), what is the current battery percentage, is Low Power Mode on, how much free storage is available, does this device have Face ID or Touch ID, and what is the screen size. Each of these is exposed as a simple property or comparison rather than requiring multiple API calls. A common use case is checking whether the current device belongs to a specific group, for example to enable or disable features that only work on certain hardware. The library models every Apple device (iPhone, iPad, iPod, Apple TV, Apple Watch) as named enum values, so comparisons are written in plain Swift without magic strings or numeric codes. DeviceKit works alongside the Simulator: every real device model also has a simulator variant, so code that checks for a specific device continues to work correctly during testing. Model identifiers come from the iPhone Wiki, a publicly maintained reference for Apple hardware. The library is available via CocoaPods, Swift Package Manager, and Carthage (three common ways to add dependencies to an Apple platform project) and also supports manual installation. It requires iOS 11, tvOS 11, or watchOS 4 or later. It is open source under the MIT license.
← devicekit on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.