mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-23 10:02:46 +02:00
CoordinatorParamters, Type -> Protocol, remove MX Prefix.
This commit is contained in:
+5
-5
@@ -24,7 +24,7 @@ final class TemplateUserProfileCoordinator: Coordinator {
|
||||
|
||||
// MARK: Private
|
||||
|
||||
private let session: MXSession
|
||||
private let parameters: TemplateUserProfileCoordinatorParameters
|
||||
private let templateUserProfileViewController: UIViewController
|
||||
private var templateUserProfileViewModel: TemplateUserProfileViewModelProtocol
|
||||
|
||||
@@ -37,11 +37,11 @@ final class TemplateUserProfileCoordinator: Coordinator {
|
||||
// MARK: - Setup
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
init(session: MXSession) {
|
||||
self.session = session
|
||||
let viewModel = TemplateUserProfileViewModel(userService: MXTemplateUserProfileService(session: session))
|
||||
init(parameters: TemplateUserProfileCoordinatorParameters) {
|
||||
self.parameters = parameters
|
||||
let viewModel = TemplateUserProfileViewModel(userService: TemplateUserProfileService(session: parameters.session))
|
||||
let view = TemplateUserProfile(viewModel: viewModel)
|
||||
.addDependency(MXAvatarService.instantiate(mediaManager: session.mediaManager))
|
||||
.addDependency(AvatarService.instantiate(mediaManager: parameters.session.mediaManager))
|
||||
templateUserProfileViewModel = viewModel
|
||||
templateUserProfileViewController = VectorHostingController(rootView: view)
|
||||
}
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
struct TemplateUserProfileCoordinatorParameters {
|
||||
let session: MXSession
|
||||
}
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
import Foundation
|
||||
|
||||
struct TemplateUserProfileViewState {
|
||||
let avatar: AvatarInputType?
|
||||
let avatar: AvatarInputProtocol?
|
||||
let displayName: String?
|
||||
var presence: TemplateUserProfilePresence
|
||||
}
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ import Foundation
|
||||
import Combine
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
class MXTemplateUserProfileService: TemplateUserProfileServiceProtocol {
|
||||
class TemplateUserProfileService: TemplateUserProfileServiceProtocol {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ struct TemplateUserProfileHeader: View {
|
||||
// MARK: Public
|
||||
|
||||
@Environment(\.theme) var theme: ThemeSwiftUI
|
||||
let avatar: AvatarInputType?
|
||||
let avatar: AvatarInputProtocol?
|
||||
let displayName: String?
|
||||
let presence: TemplateUserProfilePresence
|
||||
|
||||
|
||||
Reference in New Issue
Block a user