Instantly share code, notes, and snippets.

@fitomad fitomad/swift5_SE-0192.swift Secret
Created Jan 21, 2019

Embed
What would you like to do?
public enum Deportes
{
case futbol
case baloncesto
case tenis
}
// Vamos a ver cómo funciona esto...
let deportista = Deportes.futbol
switch deportista
{
case .futbol:
print("Jugador de fútbol")
case .baloncesto:
print("Juegas al baloncesto")
@unknown default:
print("Practicas otro tipo de deporte")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment