Skip to content

Commit

Permalink
Support for iPhone 16 models and Apple Watch Series 10. (#417)
Browse files Browse the repository at this point in the history
* Initial support for iPhone 16 models and Apple Watch Series 10.

* Version bump. (v5.5.0)

* Add missing device identifiers for new September 2024 devices.

* Fix unit tests after adding new devices.
  • Loading branch information
Zandor300 authored Sep 20, 2024
1 parent 5757447 commit 2b43271
Show file tree
Hide file tree
Showing 7 changed files with 173 additions and 33 deletions.
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
# Changelog

## Version 5.5.0

Releasedate: 2024-09-12

```ruby
pod 'DeviceKit', '~> 5.5'
```

### New September 2024 devices

This version adds support for the devices announced at the September 2024 Apple Event: ([#417](https://github.com/devicekit/DeviceKit/pull/417))

| Device | Case value |
| --- | --- |
| iPhone 16 | `Device.iPhone16` |
| iPhone 16 Plus | `Device.iPhone16Plus` |
| iPhone 16 Pro | `Device.iPhone16Pro` |
| iPhone 16 Pro Max | `Device.iPhone16ProMax` |
| Apple Watch Series 10 | `Device.appleWatchSeries10_42mm`, `Device.appleWatchSeries10_46mm` |

### Fixes

- Fix incorrect PPI for iPhone 14 Plus and iPhone 15 Plus. ([#418](https://github.com/devicekit/DeviceKit/pull/418))

### Contributors

Thanks to all the contributers of this release!
- [arindamxd](https://github.com/arindamxd)

## Version 5.4.0

Releasedate: 2024-05-30
Expand Down
2 changes: 1 addition & 1 deletion DeviceKit.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'DeviceKit'
s.version = '5.4.0'
s.version = '5.5.0'
s.summary = 'DeviceKit is a µ-framework that provides a value-type replacement of UIDevice.'

s.description = <<-DESC
Expand Down
4 changes: 2 additions & 2 deletions DeviceKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 5.4.0;
MARKETING_VERSION = 5.5.0;
MERGEABLE_LIBRARY = YES;
MTL_ENABLE_DEBUG_INFO = YES;
PRODUCT_BUNDLE_IDENTIFIER = me.dennisweissmann.DeviceKit;
Expand Down Expand Up @@ -444,7 +444,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 5.4.0;
MARKETING_VERSION = 5.5.0;
MERGEABLE_LIBRARY = YES;
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_BUNDLE_IDENTIFIER = me.dennisweissmann.DeviceKit;
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

`DeviceKit` is a value-type replacement of [`UIDevice`](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDevice_Class/).

## Current version 5.4.0
## Current version 5.5.0
See our detailed [changelog](CHANGELOG.md) for the latest features, improvements and bug fixes.

## Features
Expand Down
120 changes: 98 additions & 22 deletions Source/Device.generated.swift

Large diffs are not rendered by default.

27 changes: 22 additions & 5 deletions Source/Device.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,14 @@ iPhones = [
Device("iPhone14Plus", "Device is an [iPhone 14 Plus](https://support.apple.com/kb/SP874)", "https://support.apple.com/library/APPLE/APPLECARE_ALLGEOS/SP873/iphone-14_1_2x.png", ["iPhone14,8"], 6.7, (9, 19.5), "iPhone 14 Plus", "iPhone 14 Plus", 476, True, False, False, True, False, True, True, True, True, False, 0, False, 13, False, "a15Bionic", False, True),
Device("iPhone14Pro", "Device is an [iPhone 14 Pro](https://support.apple.com/kb/SP875)", "https://support.apple.com/library/APPLE/APPLECARE_ALLGEOS/SP875/sp875-sp876-iphone14-pro-promax_2x.png", ["iPhone15,2"], 6.1, (9, 19.5), "iPhone 14 Pro", "iPhone 14 Pro", 460, False, False, True, True, False, True, True, True, True, True, 0, False, 123, True, "a16Bionic", False, True),
Device("iPhone14ProMax", "Device is an [iPhone 14 Pro Max](https://support.apple.com/kb/SP876)", "https://support.apple.com/library/APPLE/APPLECARE_ALLGEOS/SP875/sp875-sp876-iphone14-pro-promax_2x.png", ["iPhone15,3"], 6.7, (9, 19.5), "iPhone 14 Pro Max", "iPhone 14 Pro Max", 458, True, False, True, True, False, True, True, True, True, True, 0, False, 123, True, "a16Bionic", False, True),
Device("iPhone15", "Device is an [iPhone 15]()", "", ["iPhone15,4"], 6.1, (9, 19.5), "iPhone 15", "iPhone 15", 460, False, False, False, True, False, True, True, True, True, True, 0, False, 13, False, "a16Bionic", True, True),
Device("iPhone15Plus", "Device is an [iPhone 15 Plus]()", "", ["iPhone15,5"], 6.7, (9, 19.5), "iPhone 15 Plus", "iPhone 15 Plus", 476, True, False, False, True, False, True, True, True, True, True, 0, False, 13, False, "a16Bionic", True, True),
Device("iPhone15Pro", "Device is an [iPhone 15 Pro]()", "", ["iPhone16,1"], 6.1, (9, 19.5), "iPhone 15 Pro", "iPhone 15 Pro", 460, False, False, True, True, False, True, True, True, True, True, 0, False, 123, True, "a17Pro", True, True),
Device("iPhone15ProMax", "Device is an [iPhone 15 Pro Max]()", "", ["iPhone16,2"], 6.7, (9, 19.5), "iPhone 15 Pro Max", "iPhone 15 Pro Max", 460, True, False, True, True, False, True, True, True, True, True, 0, False, 123, True, "a17Pro", True, True),

Device("iPhone15", "Device is an [iPhone 15](https://support.apple.com/en-us/111831)", "", ["iPhone15,4"], 6.1, (9, 19.5), "iPhone 15", "iPhone 15", 460, False, False, False, True, False, True, True, True, True, True, 0, False, 13, False, "a16Bionic", True, True),
Device("iPhone15Plus", "Device is an [iPhone 15 Plus](https://support.apple.com/en-us/111830)", "", ["iPhone15,5"], 6.7, (9, 19.5), "iPhone 15 Plus", "iPhone 15 Plus", 476, True, False, False, True, False, True, True, True, True, True, 0, False, 13, False, "a16Bionic", True, True),
Device("iPhone15Pro", "Device is an [iPhone 15 Pro](https://support.apple.com/en-us/111829)", "", ["iPhone16,1"], 6.1, (9, 19.5), "iPhone 15 Pro", "iPhone 15 Pro", 460, False, False, True, True, False, True, True, True, True, True, 0, False, 123, True, "a17Pro", True, True),
Device("iPhone15ProMax", "Device is an [iPhone 15 Pro Max](https://support.apple.com/en-us/111828)", "", ["iPhone16,2"], 6.7, (9, 19.5), "iPhone 15 Pro Max", "iPhone 15 Pro Max", 460, True, False, True, True, False, True, True, True, True, True, 0, False, 123, True, "a17Pro", True, True),
Device("iPhone16", "Device is an [iPhone 16]()", "", ["iPhone17,3"], 6.1, (9, 19.5), "iPhone 16", "iPhone 16", 460, False, False, False, True, False, True, True, True, True, True, 0, False, 13, False, "a18", True, True),
Device("iPhone16Plus", "Device is an [iPhone 16 Plus]()", "", ["iPhone17,4"], 6.7, (9, 19.5), "iPhone 16 Plus", "iPhone 16 Plus", 476, True, False, False, True, False, True, True, True, True, True, 0, False, 13, False, "a18", True, True),
Device("iPhone16Pro", "Device is an [iPhone 16 Pro]()", "", ["iPhone17,1"], 6.3, (9, 19.5), "iPhone 16 Pro", "iPhone 16 Pro", 460, False, False, True, True, False, True, True, True, True, True, 0, False, 123, True, "a18Pro", True, True),
Device("iPhone16ProMax", "Device is an [iPhone 16 Pro Max]()", "", ["iPhone17,2"], 6.9, (9, 19.5), "iPhone 16 Pro Max", "iPhone 16 Pro Max", 460, True, False, True, True, False, True, True, True, True, True, 0, False, 123, True, "a18Pro", True, True),
]

iPads = [
Expand Down Expand Up @@ -297,6 +300,17 @@ watches = [
"",
["Watch7,5"], 2.2, (4,5), "Apple Watch Ultra2", "Apple Watch Ultra2", 338, False, False, False, False, False, False, False, True, False, False, 0, False, 0, False, "s9", False, False),

Device(
"appleWatchSeries10_42mm",
"Device is an [Apple Watch Series 10]()",
"",
["Watch7,8", "Watch7,10"], 1.9, (374,446), "Apple Watch Series 10 42mm", "Apple Watch Series 10 42mm", 326, False, False, False, False, False, False, False, True, False, False, 0, False, 0, False, "s10", False, False),

Device(
"appleWatchSeries10_46mm",
"Device is an [Apple Watch Series 10]()",
"",
["Watch7,9", "Watch7,11"], 2.0, (416,496), "Apple Watch Series 10 46mm", "Apple Watch Series 10 46mm", 326, False, False, False, False, False, False, False, True, False, False, 0, False, 0, False, "s10", False, False),

]

Expand Down Expand Up @@ -1475,6 +1489,8 @@ iOS_cpus = [
CPU("a15Bionic", "A15 Bionic"),
CPU("a16Bionic", "A16 Bionic"),
CPU("a17Pro" , "A17 Pro"),
CPU("a18" , "A18"),
CPU("a18Pro" , "A18 Pro"),
CPU("m1", "M1"),
CPU("m2", "M2"),
CPU("m3", "M3"),
Expand All @@ -1492,6 +1508,7 @@ watchOS_cpus = [
CPU("s7", "S7"),
CPU("s8", "S8"),
CPU("s9", "S9"),
CPU("s10", "S10"),
]
}%

Expand Down
22 changes: 20 additions & 2 deletions Tests/Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,9 @@ class DeviceKitTests: XCTestCase {
.iPhone14Plus,
.iPhone14ProMax,
.iPhone15Plus,
.iPhone15ProMax
.iPhone15ProMax,
.iPhone16Plus,
.iPhone16ProMax,
])
}

Expand All @@ -471,6 +473,8 @@ class DeviceKitTests: XCTestCase {
.iPhone14ProMax,
.iPhone15Pro,
.iPhone15ProMax,
.iPhone16Pro,
.iPhone16ProMax,
.iPadPro9Inch,
.iPadPro12Inch,
.iPadPro12Inch2,
Expand Down Expand Up @@ -511,7 +515,11 @@ class DeviceKitTests: XCTestCase {
.iPhone15,
.iPhone15Plus,
.iPhone15Pro,
.iPhone15ProMax
.iPhone15ProMax,
.iPhone16,
.iPhone16Plus,
.iPhone16Pro,
.iPhone16ProMax,
]
for device in Device.allRealDevices {
XCTAssertTrue(device.hasDynamicIsland == device.isOneOf(dynamicIslandDevices), "testHasDynamicIsland failed for \(device.description)")
Expand All @@ -537,6 +545,10 @@ class DeviceKitTests: XCTestCase {
.iPhone15Plus,
.iPhone15Pro,
.iPhone15ProMax,
.iPhone16,
.iPhone16Plus,
.iPhone16Pro,
.iPhone16ProMax,
.iPad10,
.iPadAir5,
.iPadAir11M2,
Expand Down Expand Up @@ -624,6 +636,8 @@ class DeviceKitTests: XCTestCase {
.iPhone14ProMax,
.iPhone15Pro,
.iPhone15ProMax,
.iPhone16Pro,
.iPhone16ProMax,
.iPadPro11Inch2,
.iPadPro12Inch4,
.iPadPro11Inch3,
Expand All @@ -644,6 +658,10 @@ class DeviceKitTests: XCTestCase {
.iPhone15Plus,
.iPhone15Pro,
.iPhone15ProMax,
.iPhone16,
.iPhone16Plus,
.iPhone16Pro,
.iPhone16ProMax,
.iPad10,
.iPadAir4,
.iPadAir5,
Expand Down

0 comments on commit 2b43271

Please sign in to comment.