Last active
November 8, 2017 05:26
-
-
Save cyberespia/1c90cd879ee2c792855684b66216c559 to your computer and use it in GitHub Desktop.
Extrayendo el valor de una variable opcional en swift
This file contains hidden or 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
var altura:Int? = 40 // declaro una variable opcional y asigno un valor | |
altura! + 10 // para poder hacer esta suma es necesario extraer (unwrapping) del valor del opcional agregando ! (si no se hace da error) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment