Skip to content

Instantly share code, notes, and snippets.

@jaiversin
Created November 23, 2018 21:34
Show Gist options
  • Save jaiversin/4e822b80a5d87750e2e835ae81f58cb2 to your computer and use it in GitHub Desktop.
Save jaiversin/4e822b80a5d87750e2e835ae81f58cb2 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
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