My app is in full landscape mode but when picking an image from the photo album I am forced to add portrait mode. I just want portrait mode to work when selecting an image. Now it is acting weird, when having no direction lock and selecting an image while having the phone in landscape mode, the image picker is shown but in half. The right half is black and the left is the image picker in landscape (so yeah, that looks weird). This are my settings:
func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
return .all
}
In my ViewController in viewDidLoad( I need to add this in every ViewController... ):
let value = UIInterfaceOrientation.landscapeLeft.rawValue
UIDevice.current.setValue(value, forKey: "orientation")
private func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
return UIInterfaceOrientationMask.landscapeLeft
}
open override var shouldAutorotate: Bool {
get {
return false
}
}
I already looked through the answers of people questioning this. I just can not get it to work :(