Thank you to @Larme for helping. With landscape only in target settings. This will give left or right even when the device is held in the portrait orientation.
if let windowScene = UIApplication.shared.connectedScenes
.first(where: { $0 is UIWindowScene }) as? UIWindowScene {
switch windowScene.interfaceOrientation {
case .landscapeLeft:
print("Landscape Left")
case .landscapeRight:
print("Landscape Right")
}
}