Skip to content

Instantly share code, notes, and snippets.

@jaiversin
Created November 23, 2018 21:40
Show Gist options
  • Save jaiversin/f422d550ba2040ab25dec1b373d4911f to your computer and use it in GitHub Desktop.
Save jaiversin/f422d550ba2040ab25dec1b373d4911f to your computer and use it in GitHub Desktop.
class Persona {
let nombre: String
var carro: Carro?
init(nombre: String) {
self.nombre = nombre
}
}
class Carro {
let marca: String
weak var propietario: Persona?
init(marca: String) {
self.marca = marca
}
}
let jhon = Persona(nombre: "Jhon")
let transporte = Carro(marca: "BMW")
jhon.carro = transporte
transporte.propietario = jhon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment