Skip to content

Instantly share code, notes, and snippets.

@donpandix
Last active January 26, 2016 15:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save donpandix/d2f6b20d1952a0e833c6 to your computer and use it in GitHub Desktop.
Save donpandix/d2f6b20d1952a0e833c6 to your computer and use it in GitHub Desktop.
Clase sencilla en Swift, implementación para ver el scope de las propiedades
class MyClass {
let nombre:String;
init ( nombre:String ) {
self.nombre = nombre;
}
}
// Nueva instancia de la clase MyClass
let yoMismo = MyClass( nombre:"Cesar Gonzalez" );
// Imprime el nombre seteado
println( "Mi nombre es : \(yoMismo.nombre)" );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment