Last active
December 6, 2017 13:27
-
-
Save lucianoschillagi/7d29e94a191efd6ce0b2ba0395cef971 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 Password { | |
var text: String | |
var response: String? // ningún valor TODAVÍA, en principio a ´nil´ | |
init(text:String){ | |
self.text = text | |
} | |
func ask(){ | |
print(text) | |
} | |
} | |
let pasarPassword = Password(text: "Cuál es tu password?") | |
pasarPassword.ask() // prints "Cuál es tu password? | |
pasarPassword.response = "@r57^8f" // prints "@r57^8f" | |
print(pasarPassword.response ?? "No recuerdo") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment