Last active
September 3, 2015 14:32
-
-
Save PhilippeBoisney/7e117d8eaad31132c89a 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
/** | |
Le "Optionnal Chaining" permet d'effectuer une action, | |
uniquement si la variable à l'origine de l'action n'est pas égale à nil. | |
*/ | |
result = retourneParfoisNil(true) //result égale 10 | |
print(result?.getMirror()) // result égale "Optional(Swift._LeafMirror<Swift.Int>(_value: 10, summaryFunction: (Function), quickLookFunction: (Function)))" | |
result = retourneParfoisNil(false) // result égale nil | |
print(result?.getMirror()) // result égale nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment