A swift 5 client implementation of DeckOfCardsAPI
Generated using Swaggerhub
If you're running an Xcode project:
File
-> Swift packages
-> Add Package Dependency...
,git@github.com:ThumbWorks/DeckOfCards.git
in the text box1.0
for instance.import DeckOfCards
DeckAPI.newDeck { (deck, error) in
if let deck = deck {
print("we got a deck \(deck) with ID \(deck.deckId) and \(deck.remaining) cards")
}
if let error = error {
print("error \(error)")
}
}
DeckAPI.shuffleExistingDeck(deckId: deckId) { (deck, error) in
if let deck = deck {
print("shuffled: \(deck.deckId)")
}
if let error = error {
print("error \(error)")
}
}
PileAPI.addToPile(deckId: deckID,
pileName: pileName,
cards: cards.map({ card -> String in
return card.suit + card.value
}))
{ (deck, error) in
if let deck = deck {
print(deck.piles)
}
if let error = error {
print(error)
}
}