mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 16:42:44 +02:00
Add dependency management, AvatarViewModel and placeholder rendering now in AvatarImage.
This commit is contained in:
@@ -18,8 +18,8 @@ import Foundation
|
||||
import SwiftUI
|
||||
|
||||
/**
|
||||
UIHostingController that applies some level-app specific configuration
|
||||
(E.g. vectorContent modifier and themeing to the NavigationController container.
|
||||
UIHostingController that applies some app-level specific configuration
|
||||
(E.g. `vectorContent` modifier and themeing to the NavigationController container.
|
||||
*/
|
||||
@available(iOS 14.0, *)
|
||||
class VectorHostingController: UIHostingController<AnyView> {
|
||||
@@ -27,11 +27,9 @@ class VectorHostingController: UIHostingController<AnyView> {
|
||||
// MARK: Private
|
||||
|
||||
private var theme: Theme
|
||||
private var dependencyContainer = DependencyContainer()
|
||||
|
||||
init<Content>(rootView: Content) where Content: View {
|
||||
self.theme = ThemeService.shared().theme
|
||||
|
||||
super.init(rootView: AnyView(rootView.vectorContent()))
|
||||
}
|
||||
|
||||
@@ -47,10 +45,6 @@ class VectorHostingController: UIHostingController<AnyView> {
|
||||
self.update(theme: self.theme)
|
||||
}
|
||||
|
||||
func add<T>(dependency: T) {
|
||||
dependencyContainer.register(dependency: dependency)
|
||||
}
|
||||
|
||||
private func registerThemeServiceDidChangeThemeNotification() {
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(themeDidChange), name: .themeServiceDidChangeTheme, object: nil)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user