Skip to content

Instantly share code, notes, and snippets.

@cyberespia
Last active November 8, 2017 05:26
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 cyberespia/1c90cd879ee2c792855684b66216c559 to your computer and use it in GitHub Desktop.
Save cyberespia/1c90cd879ee2c792855684b66216c559 to your computer and use it in GitHub Desktop.
Extrayendo el valor de una variable opcional en swift
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