mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-30 21:26:57 +02:00
Add dependency management, AvatarViewModel and placeholder rendering now in AvatarImage.
This commit is contained in:
@@ -50,6 +50,7 @@ class AvatarService: AvatarServiceType {
|
||||
If possible to retrieve the actual image it will from network or cache, otherwise it will error.
|
||||
|
||||
- Parameter mxContentUri: matrix uri of the avatar to fetch
|
||||
- Parameter avatarSize: The size of avatar to retrieve as defined in the DesignKit spec.
|
||||
- Returns: A Future of UIImage that returns an error if it fails to fetch the image
|
||||
*/
|
||||
@available(iOS 14.0, *)
|
||||
|
||||
@@ -18,10 +18,12 @@ import Foundation
|
||||
import Combine
|
||||
import DesignKit
|
||||
|
||||
/**
|
||||
Simple ViewModel that supports loading an avatar image of a particular size
|
||||
as specified in DesignKit and delivering the UIImage to the UI if possible.
|
||||
*/
|
||||
@available(iOS 14.0, *)
|
||||
class AvatarViewModel: ObservableObject, Injectable {
|
||||
|
||||
var dependencies: DependencyContainer!
|
||||
class AvatarViewModel: InjectableObject, ObservableObject {
|
||||
|
||||
@Inject var avatarService: AvatarServiceType
|
||||
|
||||
|
||||
Reference in New Issue
Block a user