struct Card {
var rank: rank
var suit: suit
func simpleDescription() -> String {
return "The \(rank.simpleDescription()) of \(suit.simpleDescription())"
}
}
let threeOfSpades = Card(rank: .Three, suit: .Spades)
let threeOfSpadesDescription = threeOfSpades.simpleDescription()
enum ServerResponse{
case Result(String,String)
case Failure(String)
}
let success = ServerResponse. Result( "6:00 am", "8:09 pm")
let Failure = ServerResponse. Failure("Out of cheese.")
switch success {
case let .Result(sunrise,sunset):
let ServerResponse = "Sunrise is at \(sunrise) and sunset is at \(sunset)."
case let .Failure(message):
print("Failure... \(message)")
}