From 16383c54475680199a2105a51fbbfe9a0eb708e7 Mon Sep 17 00:00:00 2001 From: Zandor Smith Date: Thu, 28 Feb 2019 07:16:07 +0100 Subject: [PATCH 1/4] Add boolean and array functions to check if the device has a sensor housing. --- Source/Device.generated.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Source/Device.generated.swift b/Source/Device.generated.swift index e1d30e8d..83a17418 100644 --- a/Source/Device.generated.swift +++ b/Source/Device.generated.swift @@ -623,6 +623,11 @@ public enum Device { public static var allFaceIDCapableDevices: [Device] { return [.iPhoneX, .iPhoneXs, .iPhoneXsMax, .iPhoneXr, .iPadPro11Inch, .iPadPro12Inch3] } + + /// All devices that feature a sensor housing in the screen + public static var allDevicesWithASensorHousing: [Device] { + return [.iPhoneX, .iPhoneXs, .iPhoneXsMax, .iPhoneXr] + } /// Returns whether or not the device has Touch ID public var isTouchIDCapable: Bool { @@ -633,6 +638,11 @@ public enum Device { public var isFaceIDCapable: Bool { return isOneOf(Device.allFaceIDCapableDevices) } + + /// Returns whether or not the device has a sensor housing + public var hasSensorHousing: Bool { + return isOneOf(Device.allDevicesWithASensorHousing) + } /// Returns whether or not the device has any biometric sensor (i.e. Touch ID or Face ID) public var hasBiometricSensor: Bool { From 6bd741019b9d342b27dbfa312490b7fd17318f2d Mon Sep 17 00:00:00 2001 From: Zandor Smith Date: Sun, 3 Mar 2019 20:25:11 +0100 Subject: [PATCH 2/4] Move variables together. --- Source/Device.generated.swift | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Source/Device.generated.swift b/Source/Device.generated.swift index 83a17418..0c26e8f7 100644 --- a/Source/Device.generated.swift +++ b/Source/Device.generated.swift @@ -623,11 +623,6 @@ public enum Device { public static var allFaceIDCapableDevices: [Device] { return [.iPhoneX, .iPhoneXs, .iPhoneXsMax, .iPhoneXr, .iPadPro11Inch, .iPadPro12Inch3] } - - /// All devices that feature a sensor housing in the screen - public static var allDevicesWithASensorHousing: [Device] { - return [.iPhoneX, .iPhoneXs, .iPhoneXsMax, .iPhoneXr] - } /// Returns whether or not the device has Touch ID public var isTouchIDCapable: Bool { @@ -638,16 +633,21 @@ public enum Device { public var isFaceIDCapable: Bool { return isOneOf(Device.allFaceIDCapableDevices) } - - /// Returns whether or not the device has a sensor housing - public var hasSensorHousing: Bool { - return isOneOf(Device.allDevicesWithASensorHousing) - } /// Returns whether or not the device has any biometric sensor (i.e. Touch ID or Face ID) public var hasBiometricSensor: Bool { return isTouchIDCapable || isFaceIDCapable } + + /// All devices that feature a sensor housing in the screen + public static var allDevicesWithASensorHousing: [Device] { + return [.iPhoneX, .iPhoneXs, .iPhoneXsMax, .iPhoneXr] + } + + /// Returns whether or not the device has a sensor housing + public var hasSensorHousing: Bool { + return isOneOf(Device.allDevicesWithASensorHousing) + } #elseif os(tvOS) /// All TVs From 8fc0c1f82dc69dce7f6f3ff50497dc1c84754a6b Mon Sep 17 00:00:00 2001 From: Zandor Smith Date: Mon, 4 Mar 2019 09:49:50 +0100 Subject: [PATCH 3/4] Rename allDevicesWithASensorHousing to allDevicesWithSensorHousing. --- Source/Device.generated.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Device.generated.swift b/Source/Device.generated.swift index 0c26e8f7..2d0adec7 100644 --- a/Source/Device.generated.swift +++ b/Source/Device.generated.swift @@ -640,13 +640,13 @@ public enum Device { } /// All devices that feature a sensor housing in the screen - public static var allDevicesWithASensorHousing: [Device] { + public static var allDevicesWithSensorHousing: [Device] { return [.iPhoneX, .iPhoneXs, .iPhoneXsMax, .iPhoneXr] } /// Returns whether or not the device has a sensor housing public var hasSensorHousing: Bool { - return isOneOf(Device.allDevicesWithASensorHousing) + return isOneOf(Device.allDevicesWithSensorHousing) } #elseif os(tvOS) From 3a8bd5ec83116a24f0c802ecab292822cc0d9940 Mon Sep 17 00:00:00 2001 From: Zandor Smith Date: Mon, 4 Mar 2019 11:58:43 +0100 Subject: [PATCH 4/4] Create allDevicesWithRoundedDisplayCorners and hasRoundedDisplayCorners variables. --- Source/Device.generated.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Source/Device.generated.swift b/Source/Device.generated.swift index 2d0adec7..74b75424 100644 --- a/Source/Device.generated.swift +++ b/Source/Device.generated.swift @@ -648,6 +648,16 @@ public enum Device { public var hasSensorHousing: Bool { return isOneOf(Device.allDevicesWithSensorHousing) } + + /// All devices that feature a screen with rounded corners. + public static var allDevicesWithRoundedDisplayCorners: [Device] { + return [.iPhoneX, .iPhoneXs, .iPhoneXsMax, .iPhoneXr, .iPadPro11Inch, .iPadPro12Inch3] + } + + /// Returns whether or not the device has a screen with rounded corners. + public var hasRoundedDisplayCorners: Bool { + return isOneOf(Device.allDevicesWithRoundedDisplayCorners) + } #elseif os(tvOS) /// All TVs