Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions AUDIT-2026-06-28.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Device coverage audit — 2026-06-28

This audit checks the newest DeviceKit-covered families plus newer devices present in `kudit/Device`.

## iPhone

`Sources/Models/iPhones.swift` includes:

- iPhone 17 — `iPhone18,3`
- iPhone Air — `iPhone18,4`
- iPhone 17 Pro — `iPhone18,1`
- iPhone 17 Pro Max — `iPhone18,2`
- iPhone 17e — `iPhone18,5`

The entries include model numbers, launch OS versions, support IDs, CPU metadata, camera metadata, cellular generation, screen metadata, colors, and capabilities.

## iPad

`Sources/Models/iPads.swift` includes:

- iPad Pro 11-inch (M5) — `iPad17,1`, `iPad17,2`
- iPad Pro 13-inch (M5) — `iPad17,3`, `iPad17,4`
- iPad Air 11-inch (M4) — `iPad16,8`, `iPad16,9`
- iPad Air 13-inch (M4) — `iPad16,10`, `iPad16,11`

## Apple Watch

`Sources/Models/AppleWatches.swift` includes:

- Apple Watch SE 3 40mm — `Watch7,13`, `Watch7,15`
- Apple Watch SE 3 44mm — `Watch7,14`, `Watch7,16`
- Apple Watch Ultra 3 — `Watch7,12`
- Apple Watch Series 11 42mm — `Watch7,17`, `Watch7,19`
- Apple Watch Series 11 46mm — `Watch7,18`, `Watch7,20`

## Notes

The DeviceKit-style group arrays added in this PR are derived from the canonical `Device` model lists and capability metadata instead of hard-coded generated enum cases. That should keep these groups current automatically when future model definitions are added.
48 changes: 48 additions & 0 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Installation

## Swift Package Manager

Swift Package Manager is the recommended installation method.

```swift
dependencies: [
.package(url: "https://github.com/kudit/Device.git", from: "2.0.0"),
]
```

Then add the package product to your app target in Xcode or Swift Playgrounds and import the module:

```swift
import Device
```

## Manual installation

Manual installation is possible, but Swift Package Manager is strongly preferred because `Device` depends on the companion `Color` package and includes resources.

To install manually:

1. Add this repository to your project or workspace.
2. Add the `Sources` directory to a framework target named `Device`.
3. Add the resources in `Sources/Resources` to that target.
4. Add the `Color` package dependency from `https://github.com/kudit/Color`.
5. Link the resulting `Device` framework to your app target.

For most projects, adding the package through Xcode's **File > Add Package Dependencies…** flow is less error-prone than manually wiring the target, resources, and dependency.

## CocoaPods

CocoaPods installation is not currently published for this package. A future `Device.podspec` should include:

- the `Sources/**/*.swift` source files,
- the resources under `Sources/Resources`,
- platform deployment targets matching `Package.swift`, and
- the `Color` dependency.

Until a podspec is added and published, use Swift Package Manager.

## Carthage

Carthage installation is not currently supported. This repository is primarily a Swift Package and does not currently include a shared Xcode framework scheme intended for Carthage builds.

Until a Carthage-compatible project or scheme is added, use Swift Package Manager.
125 changes: 125 additions & 0 deletions Sources/DeviceKitGroups.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
//
// DeviceKitGroups.swift
// Device
//
// DeviceKit-style public group arrays for migration compatibility.
//

import Compatibility

public extension Device {
// MARK: - DeviceKit-style idiom groups

/// All known iPod touch devices.
static var allPods: [Device] { iPod.allDevices }

/// All known iPhone devices.
static var allPhones: [Device] { iPhone.allDevices }

/// All known iPad devices.
static var allPads: [Device] { iPad.allDevices }

/// All known Apple TV devices.
static var allTVs: [Device] { AppleTV.allDevices }

/// All known Apple Watch devices.
static var allWatches: [Device] { AppleWatch.allDevices }

/// All known HomePod devices.
static var allHomePods: [Device] { HomePod.allDevices }

/// All known Apple Vision devices.
static var allVisionDevices: [Device] { AppleVision.allDevices }

/// All known Mac devices.
static var allMacs: [Device] { Mac.allDevices }

/// All known real devices.
///
/// Unlike DeviceKit, `Device` does not model simulators as separate enum cases, so this is equivalent to `Device.all`.
static var allRealDevices: [Device] { all }

// MARK: - DeviceKit-style feature groups

/// All Plus, Max, and similarly large iPhone form factors.
static var allPlusSizedDevices: [Device] {
allPhones.filter { device in
device.has(.plus)
|| device.has(.max)
|| (device.screen?.diagonal ?? 0) >= 6.5
}
}

/// All devices marked as Pro.
static var allProDevices: [Device] { all.filter { $0.has(.pro) } }

/// All devices marked as mini.
static var allMiniDevices: [Device] { all.filter { $0.has(.mini) } }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restrict mini group to iPad minis

For DeviceKit migration compatibility, allMiniDevices should not be every device carrying the generic .mini capability. The existing DeviceKit conversion maps mini form factor as device.is(.mini) && idiom == .pad and explicitly notes that HomePod mini and iPhone mini do not count (Development/Conversions/DeviceKitConversion.swift:542); this implementation also includes iPhone 12/13 mini, HomePod mini, and Mac mini, so callers porting iPad-mini-specific layout checks will start matching unrelated products.

Useful? React with 👍 / 👎.


/// All Touch ID capable devices.
static var allTouchIDCapableDevices: [Device] {
all.filter { $0.biometrics == .touchID }
}

/// All Face ID capable devices.
static var allFaceIDCapableDevices: [Device] {
all.filter { $0.biometrics == .faceID }
}

/// All devices with Touch ID, Face ID, or Optic ID.
static var allBiometricAuthenticationCapableDevices: [Device] {
all.filter { device in
guard let biometrics = device.biometrics else { return false }
return biometrics != .none
}
}

/// All devices that feature a sensor housing in the screen.
static var allDevicesWithSensorHousing: [Device] {
allPhones.filter { $0.has(.notch) || $0.has(.dynamicIsland) }
}

/// All X-Series devices.
@available(*, deprecated, renamed: "allDevicesWithSensorHousing")
static var allXSeriesDevices: [Device] { allDevicesWithSensorHousing }

/// All devices that have rounded display corners.
static var allDevicesWithRoundedDisplayCorners: [Device] {
all.filter { $0.has(.roundedCorners) }
}

/// All devices that have the Dynamic Island.
static var allDevicesWithDynamicIsland: [Device] {
all.filter { $0.has(.dynamicIsland) }
}

/// All devices that have 3D Touch or Force Touch support.
static var allDevicesWith3dTouchSupport: [Device] {
all.filter { $0.has(.force3DTouch) }
}

/// All devices that support wireless charging.
static var allDevicesWithWirelessChargingSupport: [Device] {
all.filter { $0.has(.wirelessCharging) }
}

/// All devices that support 5G cellular.
static var allDevicesWith5gSupport: [Device] {
all.filter { $0.cellular == .fiveG }
}

/// All devices that have a LiDAR sensor.
static var allDevicesWithALidarSensor: [Device] {
all.filter { $0.has(.lidar) }
}

/// All devices that have USB-C connectivity.
static var allDevicesWithUSBCConnectivity: [Device] {
all.filter { $0.has(.usbC) }
}

/// All Apple Watches that have Force Touch support.
static var allWatchesWithForceTouchSupport: [Device] {
allWatches.filter { $0.has(.force3DTouch) }
}
}