Skip to content

Instantly share code, notes, and snippets.

View hannessolo's full-sized avatar
🚀

Hannes Hertach hannessolo

🚀
View GitHub Profile
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
}