Fix orientation to portrait, not working with pageSheet modal

This commit is contained in:
ismailgulek
2021-01-13 23:00:50 +03:00
parent 4b8ea3b431
commit 1b32e3e40c
@@ -99,12 +99,36 @@ class DialpadViewController: UIViewController {
titleLabel.text = VectorL10n.dialpadTitle
self.registerThemeServiceDidChangeThemeNotification()
self.update(theme: self.theme)
// force orientation to portrait if phone
if UIDevice.current.isPhone {
UIDevice.current.setValue(UIInterfaceOrientation.portrait.rawValue, forKey: "orientation")
}
}
override var preferredStatusBarStyle: UIStatusBarStyle {
return self.theme.statusBarStyle
}
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
// limit orientation to portrait only for phone
if UIDevice.current.isPhone {
return .portrait
}
return super.supportedInterfaceOrientations
}
override var shouldAutorotate: Bool {
return false
}
override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
if UIDevice.current.isPhone {
return .portrait
}
return super.preferredInterfaceOrientationForPresentation
}
// MARK: - Private
private func isCursorAtTheEnd() -> Bool {