This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct DependencyInjector { | |
private static var dependencyList: [String:Any] = [:] | |
static func resolve<T>() -> T { | |
guard let t = dependencyList[String(describing: T.self)] as? T else { | |
fatalError("No povider registered for type \(T.self)") | |
} | |
return t | |
} | |