Wrong device orientation
nefch opened this issue · 2 comments
nefch commented
In DayView.swift you are calling if UIDevice.current.orientation.isPortrait { ... } else { ...}
.
If an iPad has not been rotated yet, UIDevice.current.orientation
returns .unknown
. In that case your code behaves like the iPad is in Landscape although it might be in Portrait. Thus the day view looks wrong.
Solution would be to first get the UIInterfaceOrientation
(with UIApplication.shared.statusBarOrientation
or UIApplication.shared.windows.first?.windowScene?.interfaceOrientation
) and then map UIInterfaceOrientation
to UIDeviceOrientation
.
kvyatkovskys commented
Hi @nefch!
Thx for the issue. I'll check this case.