Skip to content

Instantly share code, notes, and snippets.

@astralbodies
Created May 3, 2017 00:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save astralbodies/84c13fa9eb69c812a73fb17eb6193e82 to your computer and use it in GitHub Desktop.
Save astralbodies/84c13fa9eb69c812a73fb17eb6193e82 to your computer and use it in GitHub Desktop.
Vicki Loves Jorge
class Person {
let name: String
var loves: Person?
init(_ name: String) {
self.name = name
}
func loves(_ who: Person) {
loves = who
who.loves = self
}
}
let jorge = Person("Jorge")
let vicki = Person("Vicki")
vicki.loves(jorge)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment