I'm currently working on an mobile Application which should be locked into Portrait mode only. As I can do this in my project settings it is not a problem, but I want one Viewcontroller to be shown in Landscape mode only.
I tried to disable to Portrait mode in the project settings and added this piece of code to my landscape view controller (and also the one which calls it, but with a portrait orientation):
let value = UIInterfaceOrientation.landscapeLeft.rawValue
UIDevice.current.setValue(value, forKey: "orientation")
UIViewController.attemptRotationToDeviceOrientation()
The problem I face right now is, that this solution is not optimal. The user is still able to rotate his the device. How can I fix this?