Created
March 29, 2017 14:47
-
-
Save tarunon/922dc1e58261484ea44962f209db4c22 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
protocol Injectable { | |
associatedtype Dependency = Void | |
func inject(_ dependency: Dependency) | |
} | |
extension Injectable where Dependency == Void { | |
func inject(_ depenency: Dependency) { | |
} | |
} | |
class VC: Injectable { | |
} | |
class VC2: Injectable { | |
typealias Dependency = Int | |
func inject(_ dependency: Int) { | |
print(dependency) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment