Skip to content

Instantly share code, notes, and snippets.

@stremsdoerfer
Last active November 2, 2016 04:10
Show Gist options
  • Save stremsdoerfer/76fd989c09f376df688fed746e924c27 to your computer and use it in GitHub Desktop.
Save stremsdoerfer/76fd989c09f376df688fed746e924c27 to your computer and use it in GitHub Desktop.
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