v1.1.0
The device's orientation is now available (only in iOS and Mac Catalyst).
let device = Device()
// At any time:
let currentOrientation = device.orientation
// Observe orientation changes:
var cancellables = Set<AnyCancellable>()
device.$orientation
.sink { orientation in
switch orientation {
case .portrait:
// Do portrait stuff
case .landscapeRight:
// Do landscape stuff
default:
// Handle .faceDown, .faceUp, .landscapeLeft, .portraitUpsideDown, .unknown, etc
}
}
.store(in: &cancellables)