Add dependency management, AvatarViewModel and placeholder rendering now in AvatarImage.

This commit is contained in:
David Langley
2021-08-17 10:19:41 +01:00
parent 31b4da8502
commit e09138b572
17 changed files with 103 additions and 72 deletions
+15 -2
View File
@@ -16,6 +16,19 @@
import Foundation
protocol Injectable {
var dependencies: DependencyContainer! { get }
/**
A protocol for classes that can be injected with a dependency container
*/
protocol Injectable: AnyObject {
var dependencies: DependencyContainer! { get set }
}
extension Injectable {
/**
Used to inject the dependency container into an Injectable.
*/
func inject(dependencies: DependencyContainer) {
self.dependencies = dependencies
}
}