Skip to content

Commit dbddb02

Browse files
authored
Fix bugs in v4.2.0 release (#268)
* Fix the aspect ratio of iPad Air (4th generation). * Specify that iPhone 12 Pro (Max) also are sporting a LiDAR sensor. * Update changelog and bump version to v4.2.1. * Add links to pull request and issues. * Fix LiDAR test.
1 parent 90b302a commit dbddb02

File tree

7 files changed

+24
-10
lines changed

7 files changed

+24
-10
lines changed

CHANGELOG.md

+13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## Version 4.2.1
4+
5+
Releasedate: 2020-10-22
6+
7+
```ruby
8+
pod 'DeviceKit', '~> 4.2'
9+
```
10+
11+
This version fixes a couple of bugs introduced in the v4.2.0 release:
12+
13+
- `Device.allDevicesWithALidarSensor` didn't include iPhone 12 Pro and iPhone 12 Pro Max. ([#268](https://github.com/devicekit/DeviceKit/pull/268) [#266](https://github.com/devicekit/DeviceKit/issues/266))
14+
- `Device.iPadAir4.screenRatio` returned an invalid screen ratio. ([#268](https://github.com/devicekit/DeviceKit/pull/268) [#267](https://github.com/devicekit/DeviceKit/issues/267))
15+
316
## Version 4.2.0
417

518
Releasedate: 2020-10-21

DeviceKit.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'DeviceKit'
3-
s.version = '4.2.0'
3+
s.version = '4.2.1'
44
s.summary = 'DeviceKit is a µ-framework that provides a value-type replacement of UIDevice.'
55

66
s.description = <<-DESC

DeviceKit.xcodeproj/project.pbxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@
382382
"@executable_path/Frameworks",
383383
"@loader_path/Frameworks",
384384
);
385-
MARKETING_VERSION = 4.2.0;
385+
MARKETING_VERSION = 4.2.1;
386386
MTL_ENABLE_DEBUG_INFO = YES;
387387
PRODUCT_BUNDLE_IDENTIFIER = me.dennisweissmann.DeviceKit;
388388
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -439,7 +439,7 @@
439439
"@executable_path/Frameworks",
440440
"@loader_path/Frameworks",
441441
);
442-
MARKETING_VERSION = 4.2.0;
442+
MARKETING_VERSION = 4.2.1;
443443
MTL_ENABLE_DEBUG_INFO = NO;
444444
PRODUCT_BUNDLE_IDENTIFIER = me.dennisweissmann.DeviceKit;
445445
PRODUCT_NAME = "$(TARGET_NAME)";

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

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

21-
## Current version 4.2.0
21+
## Current version 4.2.1
2222
See our detailed [changelog](CHANGELOG.md) for the latest features, improvements and bug fixes.
2323

2424
## Features

Source/Device.generated.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ public enum Device {
609609
case .iPadAir3: return (width: 3, height: 4)
610610
case .iPad7: return (width: 3, height: 4)
611611
case .iPad8: return (width: 3, height: 4)
612-
case .iPadAir4: return (width: 3, height: 4)
612+
case .iPadAir4: return (width: 41, height: 59)
613613
case .iPadMini: return (width: 3, height: 4)
614614
case .iPadMini2: return (width: 3, height: 4)
615615
case .iPadMini3: return (width: 3, height: 4)
@@ -844,7 +844,7 @@ public enum Device {
844844

845845
/// All devices that have a LiDAR sensor.
846846
public static var allDevicesWithALidarSensor: [Device] {
847-
return [.iPadPro11Inch2, .iPadPro12Inch4]
847+
return [.iPhone12Pro, .iPhone12ProMax, .iPadPro11Inch2, .iPadPro12Inch4]
848848
}
849849

850850
/// Returns whether or not the device has a LiDAR sensor.

Source/Device.swift.gyb

+3-3
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ iPhones = [
6767
Device("iPhoneSE2", "Device is an [iPhone SE (2nd generation)](https://support.apple.com/kb/SP820)", "https://support.apple.com/library/APPLE/APPLECARE_ALLGEOS/SP820/iphone-se-2nd-gen_2x.png", ["iPhone12,8"], 4.7, (9, 16), "iPhone SE (2nd generation)", "iPhone SE (2nd generation)", 326, False, False, False, False, True, False, False, True, False, 0, False, 1, False),
6868
Device("iPhone12", "Device is an [iPhone 12](TODO)", "TODO", ["iPhone13,2"], 6.1, (9, 19.5), "iPhone 12", "iPhone 12", 460, False, False, False, True, False, True, True, True, True, 0, False, 13, False),
6969
Device("iPhone12Mini", "Device is an [iPhone 12 mini](TODO)", "TODO", ["iPhone13,1"], 5.4, (9, 19.5), "iPhone 12 mini", "iPhone 12 mini", 476, False, False, False, True, False, True, True, True, True, 0, False, 13, False),
70-
Device("iPhone12Pro", "Device is an [iPhone 12 Pro](TODO)", "TODO", ["iPhone13,3"], 6.1, (9, 19.5), "iPhone 12 Pro", "iPhone 12 Pro", 460, False, False, True, True, False, True, True, True, True, 0, False, 123, False),
71-
Device("iPhone12ProMax", "Device is an [iPhone 12 Pro Max](TODO)", "TODO", ["iPhone13,4"], 6.7, (9, 19.5), "iPhone 12 Pro Max", "iPhone 12 Pro Max", 458, True, False, True, True, False, True, True, True, True, 0, False, 123, False)
70+
Device("iPhone12Pro", "Device is an [iPhone 12 Pro](TODO)", "TODO", ["iPhone13,3"], 6.1, (9, 19.5), "iPhone 12 Pro", "iPhone 12 Pro", 460, False, False, True, True, False, True, True, True, True, 0, False, 123, True),
71+
Device("iPhone12ProMax", "Device is an [iPhone 12 Pro Max](TODO)", "TODO", ["iPhone13,4"], 6.7, (9, 19.5), "iPhone 12 Pro Max", "iPhone 12 Pro Max", 458, True, False, True, True, False, True, True, True, True, 0, False, 123, True)
7272
]
7373

7474
iPads = [
@@ -82,7 +82,7 @@ iPads = [
8282
Device("iPadAir3", "Device is an [iPad Air (3rd generation)](https://support.apple.com/kb/SP787)", "https://support.apple.com/library/APPLE/APPLECARE_ALLGEOS/SP787/ipad-air-2019.jpg", ["iPad11,3", "iPad11,4"], 10.5, (3, 4), "iPad Air (3rd generation)", "iPad Air (3rd generation)", 264, False, False, False, False, True, False, False, False, False, 1, False, 1, False),
8383
Device("iPad7", "Device is an [iPad (7th generation)](https://support.apple.com/kb/SP807)", "https://support.apple.com/library/APPLE/APPLECARE_ALLGEOS/SP807/sp807-ipad-7th-gen_2x.png", ["iPad7,11", "iPad7,12"], 10.2, (3, 4), "iPad (7th generation)", "iPad (7th generation)", 264, False, False, False, False, True, False, False, False, False, 1, False, 1, False),
8484
Device("iPad8", "Device is an [iPad (8th generation)](https://support.apple.com/kb/SP822)", "https://support.apple.com/library/APPLE/APPLECARE_ALLGEOS/SP822/sp822-ipad-8gen_2x.png", ["iPad11,6", "iPad11,7"], 10.2, (3, 4), "iPad (8th generation)", "iPad (8th generation)", 264, False, False, False, False, True, False, False, False, False, 1, False, 1, False),
85-
Device("iPadAir4", "Device is an [iPad Air (4th generation)](TODO)", "TODO", ["iPad13,1", "iPad13,2"], 10.9, (3, 4), "iPad Air (4th generation)", "iPad Air (4th generation)", 264, False, False, False, False, True, False, False, False, True, 2, False, 1, False),
85+
Device("iPadAir4", "Device is an [iPad Air (4th generation)](TODO)", "TODO", ["iPad13,1", "iPad13,2"], 10.9, (41, 59), "iPad Air (4th generation)", "iPad Air (4th generation)", 264, False, False, False, False, True, False, False, False, True, 2, False, 1, False),
8686
Device("iPadMini", "Device is an [iPad Mini](https://support.apple.com/kb/SP661)", "https://support.apple.com/library/APPLE/APPLECARE_ALLGEOS/SP661/sp661_ipad_mini_color.jpg", ["iPad2,5", "iPad2,6", "iPad2,7"], 7.9, (3, 4), "iPad Mini", "iPad Mini", 163, False, True, False, False, False, False, False, False, False, 0, False, 1, False),
8787
Device("iPadMini2", "Device is an [iPad Mini 2](https://support.apple.com/kb/SP693)", "https://support.apple.com/library/APPLE/APPLECARE_ALLGEOS/SP693/SP693-specs_color-mul.png", ["iPad4,4", "iPad4,5", "iPad4,6"], 7.9, (3, 4), "iPad Mini 2", "iPad Mini 2", 326, False, True, False, False, False, False, False, False, False, 0, False, 1, False),
8888
Device("iPadMini3", "Device is an [iPad Mini 3](https://support.apple.com/kb/SP709)", "https://support.apple.com/library/APPLE/APPLECARE_ALLGEOS/SP709/SP709-space_gray.jpeg", ["iPad4,7", "iPad4,8", "iPad4,9"], 7.9, (3, 4), "iPad Mini 3", "iPad Mini 3", 326, False, True, False, False, True, False, False, False, False, 0, False, 1, False),

Tests/Tests.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,9 @@ class DeviceKitTests: XCTestCase {
433433
}
434434

435435
func testLidarValues() {
436+
let lidarDevices: [Device] = [.iPhone12Pro, .iPhone12ProMax, .iPadPro11Inch2, .iPadPro12Inch4]
436437
for device in Device.allRealDevices {
437-
XCTAssertTrue(device.hasLidarSensor == (device == .iPadPro11Inch2 || device == .iPadPro12Inch4))
438+
XCTAssertTrue(device.hasLidarSensor == device.isOneOf(lidarDevices))
438439
}
439440
}
440441

0 commit comments

Comments
 (0)