mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-24 18:42:47 +02:00
@@ -67,19 +67,34 @@ final class EnterPinCodeViewController: UIViewController {
|
||||
self.update(theme: self.theme)
|
||||
|
||||
self.viewModel.viewDelegate = self
|
||||
|
||||
if #available(iOS 13.0, *) {
|
||||
modalPresentationStyle = .fullScreen
|
||||
isModalInPresentation = true
|
||||
}
|
||||
|
||||
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 {
|
||||
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 preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
|
||||
if UIDevice.current.isPhone {
|
||||
return .portrait
|
||||
}
|
||||
return super.preferredInterfaceOrientationForPresentation
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
private func update(theme: Theme) {
|
||||
@@ -281,4 +296,12 @@ extension EnterPinCodeViewController: EnterPinCodeViewModelViewDelegate {
|
||||
self.renderPlaceholdersCount(count)
|
||||
}
|
||||
|
||||
func enterPinCodeViewModel(_ viewModel: EnterPinCodeViewModelType, didUpdateCancelButtonHidden isHidden: Bool) {
|
||||
if isHidden {
|
||||
hideCancelButton()
|
||||
} else {
|
||||
showCancelButton()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -143,6 +143,7 @@ final class EnterPinCodeViewModel: EnterPinCodeViewModelType {
|
||||
switch viewMode {
|
||||
case .setPin:
|
||||
update(viewState: .choosePin)
|
||||
self.viewDelegate?.enterPinCodeViewModel(self, didUpdateCancelButtonHidden: pinCodePreferences.forcePinProtection)
|
||||
case .unlock:
|
||||
update(viewState: .unlock)
|
||||
case .confirmPinToDeactivate:
|
||||
|
||||
@@ -21,6 +21,7 @@ import Foundation
|
||||
protocol EnterPinCodeViewModelViewDelegate: class {
|
||||
func enterPinCodeViewModel(_ viewModel: EnterPinCodeViewModelType, didUpdateViewState viewSate: EnterPinCodeViewState)
|
||||
func enterPinCodeViewModel(_ viewModel: EnterPinCodeViewModelType, didUpdatePlaceholdersCount count: Int)
|
||||
func enterPinCodeViewModel(_ viewModel: EnterPinCodeViewModelType, didUpdateCancelButtonHidden isHidden: Bool)
|
||||
}
|
||||
|
||||
protocol EnterPinCodeViewModelCoordinatorDelegate: class {
|
||||
|
||||
@@ -70,7 +70,11 @@ final class SetPinCoordinator: SetPinCoordinatorType {
|
||||
}
|
||||
|
||||
func toPresentable() -> UIViewController {
|
||||
return self.navigationRouter.toPresentable()
|
||||
let controller = self.navigationRouter.toPresentable()
|
||||
if #available(iOS 13.0, *) {
|
||||
controller.modalPresentationStyle = .fullScreen
|
||||
}
|
||||
return controller
|
||||
}
|
||||
|
||||
// MARK: - Private methods
|
||||
|
||||
Reference in New Issue
Block a user