In some cases when the orientation is neither landscape nor portrait, the reported orientation from orientation is .portrait. The orientation can be neither in some cases such as during Xcode previews after a reload when the device is already in landscape, though that also seems like a bug in Xcode previews reporting the wrong orientation.
This issue is caused by only checking if the orientation is landscape or not:
I would expect an .unknown orientation variant. This can be a breaking change, however, I would say a minor version bump is fine because:
1) If not checking with switch, the user doesn't care about other possible variants, and so this code won't affect them
2) If checking with switch, Xcode will give a compiler error, and is a very quick fix
In some cases when the orientation is neither landscape nor portrait, the reported orientation from
orientation
is.portrait
. The orientation can be neither in some cases such as during Xcode previews after a reload when the device is already in landscape, though that also seems like a bug in Xcode previews reporting the wrong orientation.This issue is caused by only checking if the orientation is landscape or not:
https://github.com/devicekit/DeviceKit/blob/4b85958a3fc1beaeab244583e4774d574a5d203f/Source/Device.generated.swift#L1869-L1875
I would expect an
.unknown
orientation variant. This can be a breaking change, however, I would say a minor version bump is fine because: 1) If not checking withswitch
, the user doesn't care about other possible variants, and so this code won't affect them 2) If checking withswitch
, Xcode will give a compiler error, and is a very quick fix