mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-18 07:28:28 +02:00
Force orientation to portrait on phones
This commit is contained in:
@@ -69,6 +69,11 @@ final class EnterPinCodeViewController: UIViewController {
|
||||
self.viewModel.viewDelegate = self
|
||||
|
||||
self.viewModel.process(viewAction: .loadData)
|
||||
|
||||
// force orientation to portrait if phone
|
||||
if UIDevice.current.isPhone {
|
||||
UIDevice.current.setValue(UIInterfaceOrientation.portrait.rawValue, forKey: "orientation")
|
||||
}
|
||||
}
|
||||
|
||||
override var preferredStatusBarStyle: UIStatusBarStyle {
|
||||
@@ -76,7 +81,18 @@ final class EnterPinCodeViewController: UIViewController {
|
||||
}
|
||||
|
||||
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
|
||||
return .portrait
|
||||
// limit orientation to portrait only for phone
|
||||
if UIDevice.current.isPhone {
|
||||
return .portrait
|
||||
}
|
||||
return super.supportedInterfaceOrientations
|
||||
}
|
||||
|
||||
override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
|
||||
if UIDevice.current.isPhone {
|
||||
return .portrait
|
||||
}
|
||||
return super.preferredInterfaceOrientationForPresentation
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
Reference in New Issue
Block a user