Created
November 23, 2018 21:40
-
-
Save jaiversin/f422d550ba2040ab25dec1b373d4911f 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 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