mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-19 16:13:42 +02:00
Update the Service Terms modal from the latest Figma.
Checkboxes have been removed from the individual policies. Reverse flow so that the service terms are show before the contacts access popup. Removes outOfContext from the modal as it will only be presented when requested. Fixes second presentation on swipe to dismiss of the modal.
This commit is contained in:
@@ -21,7 +21,7 @@ import Foundation
|
||||
@objc protocol ServiceTermsModalCoordinatorBridgePresenterDelegate {
|
||||
func serviceTermsModalCoordinatorBridgePresenterDelegateDidAccept(_ coordinatorBridgePresenter: ServiceTermsModalCoordinatorBridgePresenter)
|
||||
func serviceTermsModalCoordinatorBridgePresenterDelegateDidDecline(_ coordinatorBridgePresenter: ServiceTermsModalCoordinatorBridgePresenter, session: MXSession)
|
||||
func serviceTermsModalCoordinatorBridgePresenterDelegateDidCancel(_ coordinatorBridgePresenter: ServiceTermsModalCoordinatorBridgePresenter)
|
||||
func serviceTermsModalCoordinatorBridgePresenterDelegateDidClose(_ coordinatorBridgePresenter: ServiceTermsModalCoordinatorBridgePresenter)
|
||||
}
|
||||
|
||||
/// ServiceTermsModalCoordinatorBridgePresenter enables to start ServiceTermsModalCoordinator from a view controller.
|
||||
@@ -36,7 +36,6 @@ final class ServiceTermsModalCoordinatorBridgePresenter: NSObject {
|
||||
private let session: MXSession
|
||||
private let baseUrl: String
|
||||
private let serviceType: MXServiceType
|
||||
private let outOfContext: Bool
|
||||
private let accessToken: String
|
||||
private var coordinator: ServiceTermsModalCoordinator?
|
||||
|
||||
@@ -50,11 +49,10 @@ final class ServiceTermsModalCoordinatorBridgePresenter: NSObject {
|
||||
|
||||
// MARK: - Setup
|
||||
|
||||
init(session: MXSession, baseUrl: String, serviceType: MXServiceType, outOfContext: Bool = false, accessToken: String) {
|
||||
init(session: MXSession, baseUrl: String, serviceType: MXServiceType, accessToken: String) {
|
||||
self.session = session
|
||||
self.baseUrl = baseUrl
|
||||
self.serviceType = serviceType
|
||||
self.outOfContext = outOfContext
|
||||
self.accessToken = accessToken
|
||||
super.init()
|
||||
}
|
||||
@@ -67,9 +65,11 @@ final class ServiceTermsModalCoordinatorBridgePresenter: NSObject {
|
||||
// }
|
||||
|
||||
func present(from viewController: UIViewController, animated: Bool) {
|
||||
let serviceTermsModalCoordinator = ServiceTermsModalCoordinator(session: self.session, baseUrl: self.baseUrl, serviceType: self.serviceType, outOfContext: self.outOfContext, accessToken: accessToken)
|
||||
let serviceTermsModalCoordinator = ServiceTermsModalCoordinator(session: self.session, baseUrl: self.baseUrl, serviceType: self.serviceType, accessToken: accessToken)
|
||||
serviceTermsModalCoordinator.delegate = self
|
||||
viewController.present(serviceTermsModalCoordinator.toPresentable(), animated: animated, completion: nil)
|
||||
let presentable = serviceTermsModalCoordinator.toPresentable()
|
||||
presentable.presentationController?.delegate = self
|
||||
viewController.present(presentable, animated: animated, completion: nil)
|
||||
serviceTermsModalCoordinator.start()
|
||||
|
||||
if let coordinator = self.coordinator {
|
||||
@@ -103,8 +103,11 @@ extension ServiceTermsModalCoordinatorBridgePresenter: ServiceTermsModalCoordina
|
||||
func serviceTermsModalCoordinatorDidDecline(_ coordinator: ServiceTermsModalCoordinatorType) {
|
||||
self.delegate?.serviceTermsModalCoordinatorBridgePresenterDelegateDidDecline(self, session: self.session)
|
||||
}
|
||||
}
|
||||
|
||||
func serviceTermsModalCoordinatorDidCancel(_ coordinator: ServiceTermsModalCoordinatorType) {
|
||||
self.delegate?.serviceTermsModalCoordinatorBridgePresenterDelegateDidCancel(self)
|
||||
// MARK: - UIAdaptivePresentationControllerDelegate
|
||||
extension ServiceTermsModalCoordinatorBridgePresenter: UIAdaptivePresentationControllerDelegate {
|
||||
func presentationControllerDidDismiss(_ presentationController: UIPresentationController) {
|
||||
self.delegate?.serviceTermsModalCoordinatorBridgePresenterDelegateDidClose(self)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user