I’m trying to find a way to set the orientation of the device in my SwiftUI app.
I was following the answer here but the function UIViewController.attemptRotationToDeviceOrientation()
is deprecated. XCode tells me to use setNeedsUpdateOfSupportedInterfaceOrientations()
instead but I’m not sure how to do so. Does anyone know how to get this to work?