Skip to content

Instantly share code, notes, and snippets.

@cwalo
Created March 18, 2020 17:57
Show Gist options
  • Save cwalo/b6e9c615eab52700af327ba37f68bc0d to your computer and use it in GitHub Desktop.
Save cwalo/b6e9c615eab52700af327ba37f68bc0d to your computer and use it in GitHub Desktop.
protocol FooProtocol {}
protocol BarProtocol {}
protocol DootProtocol {}
typealias CompProtocol = FooProtocol & BarProtocol & DootProtocol
struct Dependencies: CompProtocol {}
struct SomeType {
let dependencies: FooProtocol & DootProtocol
init(_ dependencies: FooProtocol & DootProtocol) {
self.dependencies = dependencies
}
}
let dependencies = Dependencies()
let object = SomeType(dependencies)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment