0

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?

timbre timbre
  • 12,648
  • 10
  • 46
  • 77
  • If your app needs to support iOS versions below 16, you may as well stay with the deprecated function. If you only support 16+, then look at this solution instead: https://stackoverflow.com/questions/73649566/ios-16-scene-orientation-issue – timbre timbre Aug 06 '23 at 20:58

0 Answers0