mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-03 06:36:58 +02:00
wiftlint
This commit is contained in:
+6
-5
@@ -27,12 +27,12 @@ import Foundation
|
||||
/// (mainly for integration in legacy view controllers). Each bridge should be removed once the underlying Coordinator has been integrated by another Coordinator.
|
||||
@objcMembers
|
||||
final class ComposerCreateActionListBridgePresenter: NSObject {
|
||||
|
||||
// MARK: - Constants
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
|
||||
private let actions: [ComposerCreateAction]
|
||||
private var coordinator: ComposerCreateActionListCoordinator?
|
||||
|
||||
@@ -43,7 +43,9 @@ final class ComposerCreateActionListBridgePresenter: NSObject {
|
||||
// MARK: - Setup
|
||||
|
||||
init(actions: [Int]) {
|
||||
self.actions = actions.compactMap({ ComposerCreateAction(rawValue: $0) })
|
||||
self.actions = actions.compactMap {
|
||||
ComposerCreateAction(rawValue: $0)
|
||||
}
|
||||
super.init()
|
||||
}
|
||||
|
||||
@@ -55,7 +57,6 @@ final class ComposerCreateActionListBridgePresenter: NSObject {
|
||||
// }
|
||||
|
||||
func present(from viewController: UIViewController, animated: Bool) {
|
||||
|
||||
let composerCreateActionListCoordinator = ComposerCreateActionListCoordinator(actions: actions)
|
||||
composerCreateActionListCoordinator.callback = { [weak self] action in
|
||||
guard let self = self else { return }
|
||||
@@ -70,11 +71,11 @@ final class ComposerCreateActionListBridgePresenter: NSObject {
|
||||
viewController.present(presentable, animated: animated, completion: nil)
|
||||
composerCreateActionListCoordinator.start()
|
||||
|
||||
self.coordinator = composerCreateActionListCoordinator
|
||||
coordinator = composerCreateActionListCoordinator
|
||||
}
|
||||
|
||||
func dismiss(animated: Bool, completion: (() -> Void)?) {
|
||||
guard let coordinator = self.coordinator else {
|
||||
guard let coordinator = coordinator else {
|
||||
return
|
||||
}
|
||||
// Dismiss modal
|
||||
|
||||
+5
-5
@@ -23,10 +23,10 @@ enum ComposerCreateActionListCoordinatorAction {
|
||||
}
|
||||
|
||||
final class ComposerCreateActionListCoordinator: NSObject, Coordinator, Presentable, UISheetPresentationControllerDelegate {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
|
||||
private let hostingController: UIViewController
|
||||
private var view: ComposerCreateActionList
|
||||
private var viewModel: ComposerCreateActionListViewModel
|
||||
@@ -41,7 +41,7 @@ final class ComposerCreateActionListCoordinator: NSObject, Coordinator, Presenta
|
||||
|
||||
init(actions: [ComposerCreateAction]) {
|
||||
viewModel = ComposerCreateActionListViewModel(initialViewState: ComposerCreateActionListViewState(actions: actions))
|
||||
self.view = ComposerCreateActionList(viewModel: viewModel.context)
|
||||
view = ComposerCreateActionList(viewModel: viewModel.context)
|
||||
let hostingVC = VectorHostingController(rootView: view)
|
||||
hostingVC.bottomSheetPreferences = VectorHostingBottomSheetPreferences(detents: [.medium])
|
||||
hostingController = hostingVC
|
||||
@@ -62,10 +62,10 @@ final class ComposerCreateActionListCoordinator: NSObject, Coordinator, Presenta
|
||||
}
|
||||
|
||||
func toPresentable() -> UIViewController {
|
||||
return self.hostingController
|
||||
hostingController
|
||||
}
|
||||
|
||||
func presentationControllerDidDismiss(_ presentationController: UIPresentationController) {
|
||||
self.callback?(.cancel)
|
||||
}
|
||||
callback?(.cancel)
|
||||
}
|
||||
}
|
||||
|
||||
+1
-2
@@ -1,4 +1,4 @@
|
||||
//
|
||||
//
|
||||
// Copyright 2022 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -31,7 +31,6 @@ enum ComposerCreateActionListViewModelResult: Equatable {
|
||||
// MARK: View
|
||||
|
||||
struct ComposerCreateActionListViewState: BindableState {
|
||||
|
||||
/// The list of composer create actions to display to the user
|
||||
let actions: [ComposerCreateAction]
|
||||
}
|
||||
|
||||
+1
-2
@@ -1,4 +1,4 @@
|
||||
//
|
||||
//
|
||||
// Copyright 2022 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -17,7 +17,6 @@
|
||||
import SwiftUI
|
||||
|
||||
struct ComposerCreateActionList: View {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
//
|
||||
//
|
||||
// Copyright 2022 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
||||
-1
@@ -19,7 +19,6 @@ import SwiftUI
|
||||
typealias ComposerCreateActionListViewModelType = StateStoreViewModel<ComposerCreateActionListViewState, ComposerCreateActionListViewAction>
|
||||
|
||||
class ComposerCreateActionListViewModel: ComposerCreateActionListViewModelType, ComposerCreateActionListViewModelProtocol {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
|
||||
Reference in New Issue
Block a user