Skip to content

Instantly share code, notes, and snippets.

@leopic
Created June 24, 2015 05:59
Show Gist options
  • Save leopic/79b8b9ffa4eb5ab7ea90 to your computer and use it in GitHub Desktop.
Save leopic/79b8b9ffa4eb5ab7ea90 to your computer and use it in GitHub Desktop.
If you assign an instance of a reference type to a constant, you can still change that instance’s variable properties.
class Persona { var nombre:String? }
let alejo = Persona()
alejo.nombre = "Alejo"
if let nombre = alejo.nombre {
println(nombre)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment