I have encountered problem when presenting view controller and changing its orientation to landscape at the same time. It's just working fine with devices in iOS 12 and below. It's also working fine with iPhones in iOS 13.
override func viewWillAppear(_ animated: Bool) {
self.addObserver()
let value = UIInterfaceOrientation.landscapeRight.rawValue
UIDevice.current.setValue(value, forKey: "orientation")
}
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return .landscapeRight
}
override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
return .landscapeRight
}