Last active
March 22, 2018 21:01
-
-
Save garsdle/e5e6ce3f8a777a337dcb6dbdb67f7390 to your computer and use it in GitHub Desktop.
Injection of a class into another
This file contains hidden or 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
class Helper { /* I do helpful things */ } | |
class MainClass { | |
let helper: Helper | |
init(helper: Helper) { | |
self.helper = helper | |
} | |
} | |
let helper = Helper() | |
let mainClass = MainClass(helper: helper) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment