Created
May 3, 2017 00:49
-
-
Save astralbodies/84c13fa9eb69c812a73fb17eb6193e82 to your computer and use it in GitHub Desktop.
Vicki Loves Jorge
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 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