Skip to content

Instantly share code, notes, and snippets.

@pjwelcome
Created April 15, 2018 13:53
Show Gist options
  • Save pjwelcome/03a4ba74b145dd999db2179e2a642095 to your computer and use it in GitHub Desktop.
Save pjwelcome/03a4ba74b145dd999db2179e2a642095 to your computer and use it in GitHub Desktop.
extension DepedencyContainer : Resolvable {
public func resolve<T>(_ dependency: T.Type) -> T {
guard let implementation = container.resolve(dependency) else {
fatalError("Nothing to Resolve")
}
return implementation
}
public func reset() {
container.removeAll()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment