From f51b05fe60c13efb80e6f2f6e0e2806f58b21d88 Mon Sep 17 00:00:00 2001 From: George Elsham <40073010+GeorgeElsham@users.noreply.github.com> Date: Wed, 1 May 2024 20:34:18 +0100 Subject: [PATCH] Add unknown orientation variant --- Source/Device.generated.swift | 6 +++++- Source/Device.swift.gyb | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Source/Device.generated.swift b/Source/Device.generated.swift index 00bb6b9..4047794 100644 --- a/Source/Device.generated.swift +++ b/Source/Device.generated.swift @@ -1860,17 +1860,21 @@ extension Device { This enum describes the state of the orientation. - Landscape: The device is in Landscape Orientation - Portrait: The device is in Portrait Orientation + - Unknown: The device orientation is unknown. */ public enum Orientation { case landscape case portrait + case unknown } public var orientation: Orientation { if UIDevice.current.orientation.isLandscape { return .landscape - } else { + } else if UIDevice.current.orientation.isPortrait { return .portrait + } else { + return .unknown } } } diff --git a/Source/Device.swift.gyb b/Source/Device.swift.gyb index d632216..5fec3e8 100644 --- a/Source/Device.swift.gyb +++ b/Source/Device.swift.gyb @@ -1176,17 +1176,21 @@ extension Device { This enum describes the state of the orientation. - Landscape: The device is in Landscape Orientation - Portrait: The device is in Portrait Orientation + - Unknown: The device orientation is unknown. */ public enum Orientation { case landscape case portrait + case unknown } public var orientation: Orientation { if UIDevice.current.orientation.isLandscape { return .landscape - } else { + } else if UIDevice.current.orientation.isPortrait { return .portrait + } else { + return .unknown } } }