Stop few screen landscape orientation in Swiftui

240 Views Asked by At

I am using SwiftUI and Swift in my application. Few screens are expected to support both landscape or portrait orientation.

In Swift, i am using below code to support landscape and portrait orientation

    UIDevice.current.setValue(NSNumber(value: orientation), forKey: "orientation")
    UINavigationController.attemptRotationToDeviceOrientation()

But i don't know how to do landscape orientation in SwiftUI.

0

There are 0 best solutions below