Skip to content

Commit 46fce1b

Browse files
Zandor300claude
andcommitted
Fix ApplePencilSupport OptionSet raw values to use non-overlapping bits
The firstGenerationUsbC raw value (0x03) overlapped with firstGeneration (0x01) and secondGeneration (0x02), causing contains() checks to return incorrect results. Changed to proper power-of-2 values. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a50c628 commit 46fce1b

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
- Fixed iPhone Air incorrectly marked as having ultra-wide camera. ([#463](https://github.com/devicekit/DeviceKit/pull/463))
2020
- Fixed Apple Pencil compatibility for M4 iPad Pro, M2/M3 iPad Air, iPad (10th gen), and iPad (A16) models. ([#474](https://github.com/devicekit/DeviceKit/pull/474))
21+
- Fixed `ApplePencilSupport` OptionSet raw values so that `.firstGenerationUsbC` no longer incorrectly overlaps with `.firstGeneration` and `.secondGeneration`. ([#474](https://github.com/devicekit/DeviceKit/pull/474))
2122

2223
## Version 5.7.0
2324

Source/Device.generated.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2217,8 +2217,8 @@ extension Device {
22172217

22182218
public static let firstGeneration = ApplePencilSupport(rawValue: 0x01)
22192219
public static let secondGeneration = ApplePencilSupport(rawValue: 0x02)
2220-
public static let firstGenerationUsbC = ApplePencilSupport(rawValue: 0x03)
2221-
public static let pro = ApplePencilSupport(rawValue: 0x04)
2220+
public static let firstGenerationUsbC = ApplePencilSupport(rawValue: 0x04)
2221+
public static let pro = ApplePencilSupport(rawValue: 0x08)
22222222
}
22232223

22242224
/// All Apple Pencil Capable Devices

Source/Device.swift.gyb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,8 +1332,8 @@ extension Device {
13321332

13331333
public static let firstGeneration = ApplePencilSupport(rawValue: 0x01)
13341334
public static let secondGeneration = ApplePencilSupport(rawValue: 0x02)
1335-
public static let firstGenerationUsbC = ApplePencilSupport(rawValue: 0x03)
1336-
public static let pro = ApplePencilSupport(rawValue: 0x04)
1335+
public static let firstGenerationUsbC = ApplePencilSupport(rawValue: 0x04)
1336+
public static let pro = ApplePencilSupport(rawValue: 0x08)
13371337
}
13381338

13391339
/// All Apple Pencil Capable Devices

0 commit comments

Comments
 (0)