TestsTested | ✓ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Mar 2015 |
SPMSupports SPM | ✗ |
Maintained by Matthew Palmer.
A generic Deck type, like a deck of cards or a slide deck.
A Deck is similar to a Stack, except that you can go forwards and backwards through it. When you get to the end of a Stack, it loops back around to the start.
Create a new Deck with the provided ‘Cards’, where 'Cards’ are really anything.
let firstFive = Deck(cards: [1, 2, 3, 4, 5])
Move forwards and backwards through the Deck
firstFive.currentCard() // == 1
firstFive.nextCard() // == 2
firstFive.nextCard() // == 3
firstFive.previousCard() // == 2
firstFive.previousCard() // == 1
This is implemented in Swift, so iOS 8.0+ is required.
matthewpalmer, [email protected]
Deck is available under the MIT license. See the LICENSE file for more info.