Last active
November 8, 2017 05:26
-
-
Save cyberespia/87499d2b196b33e133d85bae8eba38da to your computer and use it in GitHub Desktop.
Condicional Switch en swift
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
let edad = 75 | |
switch edad { | |
case 0: | |
print("recien nacido") | |
case 1...12: | |
print("Niño") | |
case 13...18: | |
print("Adolescente") | |
case ...65: // One-Sided Ranges solo en Swift 4. | |
print("Adulto") | |
default: | |
print("Viejo") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment