Skip to content

Instantly share code, notes, and snippets.

@ronstar
Last active December 8, 2020 07:12
Show Gist options
  • Save ronstar/1bd30c03c761f900516e38c7d793b271 to your computer and use it in GitHub Desktop.
Save ronstar/1bd30c03c761f900516e38c7d793b271 to your computer and use it in GitHub Desktop.
Configurable resolve
func resolve<Service: Configurable>(type: Service.Type, configuration: Service.Configuration) -> Service? {
let service = resolve(type: type) // 1
service?.configure(configuration: configuration) // 2
return service
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment