From dbddb0296e3ee4f83d52f9681e42705020a533e4 Mon Sep 17 00:00:00 2001 From: Zandor Smith Date: Thu, 22 Oct 2020 20:00:43 +0200 Subject: [PATCH] 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. --- CHANGELOG.md | 13 +++++++++++++ DeviceKit.podspec | 2 +- DeviceKit.xcodeproj/project.pbxproj | 4 ++-- README.md | 2 +- Source/Device.generated.swift | 4 ++-- Source/Device.swift.gyb | 6 +++--- Tests/Tests.swift | 3 ++- 7 files changed, 24 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a976fef..5a4ac50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## Version 4.2.1 + +Releasedate: 2020-10-22 + +```ruby +pod 'DeviceKit', '~> 4.2' +``` + +This version fixes a couple of bugs introduced in the v4.2.0 release: + +- `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)) +- `Device.iPadAir4.screenRatio` returned an invalid screen ratio. ([#268](https://github.com/devicekit/DeviceKit/pull/268) [#267](https://github.com/devicekit/DeviceKit/issues/267)) + ## Version 4.2.0 Releasedate: 2020-10-21 diff --git a/DeviceKit.podspec b/DeviceKit.podspec index 2d4bba2..8b962ff 100644 --- a/DeviceKit.podspec +++ b/DeviceKit.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'DeviceKit' - s.version = '4.2.0' + s.version = '4.2.1' s.summary = 'DeviceKit is a ยต-framework that provides a value-type replacement of UIDevice.' s.description = <<-DESC diff --git a/DeviceKit.xcodeproj/project.pbxproj b/DeviceKit.xcodeproj/project.pbxproj index 351d644..be7f6dd 100644 --- a/DeviceKit.xcodeproj/project.pbxproj +++ b/DeviceKit.xcodeproj/project.pbxproj @@ -382,7 +382,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 4.2.0; + MARKETING_VERSION = 4.2.1; MTL_ENABLE_DEBUG_INFO = YES; PRODUCT_BUNDLE_IDENTIFIER = me.dennisweissmann.DeviceKit; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -439,7 +439,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 4.2.0; + MARKETING_VERSION = 4.2.1; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = me.dennisweissmann.DeviceKit; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/README.md b/README.md index 485a50a..8359978 100644 --- a/README.md +++ b/README.md @@ -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 4.2.0 +## Current version 4.2.1 See our detailed [changelog](CHANGELOG.md) for the latest features, improvements and bug fixes. ## Features diff --git a/Source/Device.generated.swift b/Source/Device.generated.swift index 5ceb2cc..67c05c3 100644 --- a/Source/Device.generated.swift +++ b/Source/Device.generated.swift @@ -609,7 +609,7 @@ public enum Device { case .iPadAir3: return (width: 3, height: 4) case .iPad7: return (width: 3, height: 4) case .iPad8: return (width: 3, height: 4) - case .iPadAir4: return (width: 3, height: 4) + case .iPadAir4: return (width: 41, height: 59) case .iPadMini: return (width: 3, height: 4) case .iPadMini2: return (width: 3, height: 4) case .iPadMini3: return (width: 3, height: 4) @@ -844,7 +844,7 @@ public enum Device { /// All devices that have a LiDAR sensor. public static var allDevicesWithALidarSensor: [Device] { - return [.iPadPro11Inch2, .iPadPro12Inch4] + return [.iPhone12Pro, .iPhone12ProMax, .iPadPro11Inch2, .iPadPro12Inch4] } /// Returns whether or not the device has a LiDAR sensor. diff --git a/Source/Device.swift.gyb b/Source/Device.swift.gyb index 31b85ee..8feb2ec 100644 --- a/Source/Device.swift.gyb +++ b/Source/Device.swift.gyb @@ -67,8 +67,8 @@ iPhones = [ 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), 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), 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), - 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), - 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) + 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), + 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) ] iPads = [ @@ -82,7 +82,7 @@ iPads = [ 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), 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), 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), - 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), + 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), 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), 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), 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), diff --git a/Tests/Tests.swift b/Tests/Tests.swift index dcb3851..42de35b 100644 --- a/Tests/Tests.swift +++ b/Tests/Tests.swift @@ -433,8 +433,9 @@ class DeviceKitTests: XCTestCase { } func testLidarValues() { + let lidarDevices: [Device] = [.iPhone12Pro, .iPhone12ProMax, .iPadPro11Inch2, .iPadPro12Inch4] for device in Device.allRealDevices { - XCTAssertTrue(device.hasLidarSensor == (device == .iPadPro11Inch2 || device == .iPadPro12Inch4)) + XCTAssertTrue(device.hasLidarSensor == device.isOneOf(lidarDevices)) } }