I have been getting the interface orientation using the following line of code.
let orientation = UIApplication.shared.windows.first?.windowScene?.interfaceOrientation
However, my new app is targeting iOS 15 and above and I now receive a warning 'windows' was deprecated in iOS 15.0: Use UIWindowScene.windows on a relevant window scene instead
How do I get rid of this warning and what is the best way to retrieve the device orientation in iOS 15?