Is there a way to add method at class level or struct level in swift?
struct Card {
var rank: Rank
var suit: Suit
func simpleDescription() -> String {
return "The \(rank.simpleDescription()) of \(suit.simpleDescription())"
}
}
Excerpt From: Apple Inc. “The Swift Programming Language.” iBooks. https://itun.es/us/jEUH0.l
Now if you wanted to add a method that creates a full deck of cards, what would be the best way to accomplish it?