mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-27 11:46:58 +02:00
Configured and applied SwiftFormat
This commit is contained in:
committed by
Stefan Ceriu
parent
ff2e6ddfa7
commit
43c28d23b7
@@ -26,7 +26,6 @@ enum RoomAccessCoordinatorCoordinatorAction {
|
||||
|
||||
@objcMembers
|
||||
final class RoomAccessCoordinator: Coordinator {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
@@ -35,7 +34,7 @@ final class RoomAccessCoordinator: Coordinator {
|
||||
private var upgradedRoomId: String?
|
||||
|
||||
private var navigationRouter: NavigationRouterType {
|
||||
return self.parameters.navigationRouter
|
||||
parameters.navigationRouter
|
||||
}
|
||||
|
||||
// MARK: Public
|
||||
@@ -58,32 +57,31 @@ final class RoomAccessCoordinator: Coordinator {
|
||||
|
||||
init(parameters: RoomAccessCoordinatorParameters) {
|
||||
self.parameters = parameters
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Public
|
||||
|
||||
|
||||
func start() {
|
||||
MXLog.debug("[RoomAccessCoordinator] did start.")
|
||||
let rootCoordinator = self.createRoomAccessTypeCoordinator()
|
||||
let rootCoordinator = createRoomAccessTypeCoordinator()
|
||||
rootCoordinator.start()
|
||||
|
||||
self.add(childCoordinator: rootCoordinator)
|
||||
self.accessCoordinator = rootCoordinator
|
||||
add(childCoordinator: rootCoordinator)
|
||||
accessCoordinator = rootCoordinator
|
||||
|
||||
if self.navigationRouter.modules.isEmpty == false {
|
||||
self.navigationRouter.push(rootCoordinator, animated: true, popCompletion: { [weak self] in
|
||||
if navigationRouter.modules.isEmpty == false {
|
||||
navigationRouter.push(rootCoordinator, animated: true, popCompletion: { [weak self] in
|
||||
self?.remove(childCoordinator: rootCoordinator)
|
||||
})
|
||||
} else {
|
||||
self.navigationRouter.setRootModule(rootCoordinator) { [weak self] in
|
||||
navigationRouter.setRootModule(rootCoordinator) { [weak self] in
|
||||
self?.remove(childCoordinator: rootCoordinator)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func toPresentable() -> UIViewController {
|
||||
return self.navigationRouter.toPresentable()
|
||||
navigationRouter.toPresentable()
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
@@ -91,7 +89,7 @@ final class RoomAccessCoordinator: Coordinator {
|
||||
func pushScreen(with coordinator: Coordinator & Presentable) {
|
||||
add(childCoordinator: coordinator)
|
||||
|
||||
self.navigationRouter.push(coordinator, animated: true, popCompletion: { [weak self] in
|
||||
navigationRouter.push(coordinator, animated: true, popCompletion: { [weak self] in
|
||||
self?.remove(childCoordinator: coordinator)
|
||||
})
|
||||
|
||||
@@ -103,13 +101,13 @@ final class RoomAccessCoordinator: Coordinator {
|
||||
|
||||
coordinator.toPresentable().modalPresentationStyle = .overFullScreen
|
||||
coordinator.toPresentable().modalTransitionStyle = .crossDissolve
|
||||
self.navigationRouter.present(coordinator, animated: true)
|
||||
navigationRouter.present(coordinator, animated: true)
|
||||
|
||||
coordinator.start()
|
||||
}
|
||||
|
||||
private func createRoomAccessTypeCoordinator() -> RoomAccessTypeChooserCoordinator {
|
||||
let coordinator: RoomAccessTypeChooserCoordinator = RoomAccessTypeChooserCoordinator(parameters: RoomAccessTypeChooserCoordinatorParameters(roomId: parameters.room.roomId, allowsRoomUpgrade: parameters.allowsRoomUpgrade, session: parameters.room.mxSession))
|
||||
let coordinator = RoomAccessTypeChooserCoordinator(parameters: RoomAccessTypeChooserCoordinatorParameters(roomId: parameters.room.roomId, allowsRoomUpgrade: parameters.allowsRoomUpgrade, session: parameters.room.mxSession))
|
||||
coordinator.callback = { [weak self] result in
|
||||
guard let self = self else { return }
|
||||
|
||||
@@ -132,7 +130,8 @@ final class RoomAccessCoordinator: Coordinator {
|
||||
let paramaters = MatrixItemChooserCoordinatorParameters(
|
||||
session: parameters.room.mxSession,
|
||||
viewProvider: RoomRestrictedAccessSpaceChooserViewProvider(navTitle: VectorL10n.roomAccessSettingsScreenNavTitle),
|
||||
itemsProcessor: RoomRestrictedAccessSpaceChooserItemsProcessor(roomId: roomId, session: parameters.room.mxSession))
|
||||
itemsProcessor: RoomRestrictedAccessSpaceChooserItemsProcessor(roomId: roomId, session: parameters.room.mxSession)
|
||||
)
|
||||
let coordinator = MatrixItemChooserCoordinator(parameters: paramaters)
|
||||
coordinator.completion = { [weak self] result in
|
||||
guard let self = self else { return }
|
||||
@@ -154,7 +153,8 @@ final class RoomAccessCoordinator: Coordinator {
|
||||
session: parameters.room.mxSession,
|
||||
roomId: roomId,
|
||||
parentSpaceId: parameters.parentSpaceId,
|
||||
versionOverride: versionOverride)
|
||||
versionOverride: versionOverride
|
||||
)
|
||||
let coordinator = RoomUpgradeCoordinator(parameters: paramaters)
|
||||
|
||||
coordinator.completion = { [weak self] result in
|
||||
|
||||
+5
-8
@@ -1,4 +1,5 @@
|
||||
//
|
||||
import MatrixSDK
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -14,7 +15,6 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
import UIKit
|
||||
import MatrixSDK
|
||||
|
||||
@objc protocol RoomAccessCoordinatorBridgePresenterDelegate {
|
||||
func roomAccessCoordinatorBridgePresenterDelegate(_ coordinatorBridgePresenter: RoomAccessCoordinatorBridgePresenter, didCancelRoomWithId roomId: String)
|
||||
@@ -27,7 +27,6 @@ import MatrixSDK
|
||||
/// Each bridge should be removed once the underlying Coordinator has been integrated by another Coordinator.
|
||||
@objcMembers
|
||||
final class RoomAccessCoordinatorBridgePresenter: NSObject {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
@@ -82,7 +81,7 @@ final class RoomAccessCoordinatorBridgePresenter: NSObject {
|
||||
}
|
||||
|
||||
func dismiss(animated: Bool, completion: (() -> Void)?) {
|
||||
guard let coordinator = self.coordinator else {
|
||||
guard let coordinator = coordinator else {
|
||||
return
|
||||
}
|
||||
coordinator.toPresentable().dismiss(animated: animated) {
|
||||
@@ -98,13 +97,11 @@ final class RoomAccessCoordinatorBridgePresenter: NSObject {
|
||||
// MARK: - UIAdaptivePresentationControllerDelegate
|
||||
|
||||
extension RoomAccessCoordinatorBridgePresenter: UIAdaptivePresentationControllerDelegate {
|
||||
|
||||
func roomNotificationSettingsCoordinatorDidComplete(_ presentationController: UIPresentationController) {
|
||||
if let roomId = self.coordinator?.currentRoomId {
|
||||
self.delegate?.roomAccessCoordinatorBridgePresenterDelegate(self, didCancelRoomWithId: roomId)
|
||||
if let roomId = coordinator?.currentRoomId {
|
||||
delegate?.roomAccessCoordinatorBridgePresenterDelegate(self, didCancelRoomWithId: roomId)
|
||||
} else {
|
||||
self.delegate?.roomAccessCoordinatorBridgePresenterDelegate(self, didCancelRoomWithId: self.room.roomId)
|
||||
delegate?.roomAccessCoordinatorBridgePresenterDelegate(self, didCancelRoomWithId: room.roomId)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ import Foundation
|
||||
|
||||
/// RoomAccessCoordinator input parameters
|
||||
struct RoomAccessCoordinatorParameters {
|
||||
|
||||
/// The Matrix room
|
||||
let room: MXRoom
|
||||
|
||||
|
||||
Reference in New Issue
Block a user