Skip to content

Instantly share code, notes, and snippets.

@ronstar
Created December 8, 2020 06:58
Show Gist options
  • Save ronstar/b46b6980b1e08fa2cccc51e7a592f809 to your computer and use it in GitHub Desktop.
Save ronstar/b46b6980b1e08fa2cccc51e7a592f809 to your computer and use it in GitHub Desktop.
Configurable example
dic.register(type: ServiceThreeConfigurable.self) { (dic) -> AnyObject in // 1
return ServiceThreeConfigurable(serviceOne: dic.resolve(type: ServiceOneProtocol.self)!)
}
let configuration = ServiceThreeConfigurable.ServiceThreeConfiguration(paramOne: true, paramTwo: Data()) // 2
let serviceThree = dic.resolve(type: ServiceThreeConfigurable.self, configuration: configuration) // 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment