Skip to content

Instantly share code, notes, and snippets.

@AppleCEO
Last active August 12, 2021 04:30
Show Gist options
  • Save AppleCEO/2cb101dbd1b732092f1386c9b6f53071 to your computer and use it in GitHub Desktop.
Save AppleCEO/2cb101dbd1b732092f1386c9b6f53071 to your computer and use it in GitHub Desktop.
struct Programmer {
private let coffee: Coffee
init(coffee: Coffee) {
self.coffee = coffee
}
func startProgramming() {
self.coffee.drink()
//...
}
}
let americano = Coffee(name: "아메리카노")
let programmer = Programmer(coffee: americano)
programmer.startProgramming()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment