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
// valores raw implícitos de tipo String | |
enum Monedas: String { | |
case DolarAmericano | |
case PesoCubano | |
case LibraEsterlina | |
case Yen | |
} | |
let peso = Monedas.PesoCubano.rawValue |
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
// valores raw implícitos desde un valor explícitamente proporcionado | |
enum Monedas: Int { | |
case DolarAmericano = 1 | |
case PesoCubano | |
case LibraEsterlina | |
case Yen | |
} | |
let dolar = Monedas.DolarAmericano.rawValue | |
let peso = Monedas.PesoCubano.rawValue |
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
// valores raw implícitos desde 0 | |
enum Monedas: Int { | |
case DolarAmericano | |
case PesoCubano | |
case LibraEsterlina | |
case Yen | |
} | |
let dolar = Monedas.DolarAmericano.rawValue | |
let peso = Monedas.PesoCubano.rawValue |
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
enum Monedas: String { | |
case DolarAmericano = "USD" | |
case PesoCubano = "CUP" | |
case LibraEsterlina = "GBP" | |
case Yen = "JPY" | |
} |
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
switch diaDeLaSemana { | |
case .Martes: | |
print("es martes") | |
default: | |
print("no es martes") | |
} |
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
switch diaDeLaSemana { | |
case .Lunes: | |
print("es lunes") | |
case .Martes: | |
print("es martes") | |
case .Miercoles: | |
print("es miércoles") | |
case .Jueves: | |
print("es jueves") | |
case .Viernes: |
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
diaDeLaSemana = .Miercoles | |
diaDeLaSemana = .Domingo |
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
var diaDeLaSemana = DiasSemana.Lunes |
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
enum DiasSemana { | |
case Lunes, Martes, Miercoles, Jueves, Viernes, Sabado, Domingo | |
} |
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
enum PosicionesCampoBeisbol { | |
case Lanzador | |
case Receptor | |
case PrimeraBase | |
case SegundaBase | |
case TerceraBase | |
case Campocorto | |
case JardineroIzquierdo | |
case JardineroCentral | |
case JardineroDerecho |