Releases: backslash-f/device
Releases · backslash-f/device
v1.1.1
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)
v1.0.0
Allows for checking the device type and operating system.
This retires the following package: https://github.com/backslash-f/operating-system