Created
April 15, 2018 13:53
-
-
Save pjwelcome/03a4ba74b145dd999db2179e2a642095 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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