self
import SwiftUI struct UIViewContainer: UIViewRepresentable { @Binding var orientation: UIDeviceOrientation init(orientation: Binding<UIDeviceOrientation>) { self._orientation = orientation } func updateUIView(_ uiView: CameraView, context: Context) { // Update device orientation. } }
import SwiftUI struct ContentView : View { var body: some View { UIViewContainer(orientation: $orientation) .onReceive(NotificationCenter.default.publisher(for: UIDevice.orientationDidChangeNotification)) { _ in orientation = UIDevice.current.orientation } } }
There was an error while loading. Please reload this page.