Last active
November 2, 2016 04:10
-
-
Save stremsdoerfer/76fd989c09f376df688fed746e924c27 to your computer and use it in GitHub Desktop.
This file contains 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 apartment: Apartment? | |
init(name: String) { self.name = name } | |
} | |
class Apartment { | |
let unit: String | |
var tenant: Person? | |
init(unit: String) { self.unit = unit } | |
} | |
... | |
func someFunction(){ | |
let john = Person(name: "John Appleseed") | |
let unit4A = Apartment(unit: "4A") | |
john.apartment = unit4A | |
unit4A.tenant = john | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment