Last active
August 12, 2021 04:30
-
-
Save AppleCEO/2cb101dbd1b732092f1386c9b6f53071 to your computer and use it in GitHub Desktop.
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
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