Last active
January 15, 2019 10:48
-
-
Save LizzieStudeneer/2c484522a9a7afe570ff54364665df51 to your computer and use it in GitHub Desktop.
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
// MARK: Resolver | |
func resolve<ServiceType>(_ type: ServiceType.Type) -> ServiceType { | |
guard let factory = factories.first(where: { $0.supports(type) }) else { | |
fatalError("No suitable factory found") | |
} | |
return factory.resolve(self) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment