0

I am listening for existing orientation changes by using UIDevice.orientationDidChangeNotification, but is there a way to lock a SwiftUI View into a particular orientation?

I do not want to introduce AppDelegate.

Example:

import SwiftUI

struct TestView: View {
  var text: String
  
  var body: some View {
    Text(text)
  }
}
Tejzeratul
  • 343
  • 6
  • 15

0 Answers0